1
0
Fork 0
arangodb/js/apps/system/aardvark/templates/setup.js.tmpl

19 lines
519 B
Cheetah

(function () {
'use strict';
var console = require("console");
var db = require("org/arangodb").db;
var createCollection = function(collection) {
var name = applicationContext.collectionName(collection);
if (db._collection(name) === null) {
db._create(name);
} else if (applicationContext.isProduction) {
console.warn("collection '%s' already exists. Leaving it untouched.", name);
}
};
<% _.each(collections, function(c) { %>
createCollection("<%= c %>");
<% }); %>
}());