1
0
Fork 0
arangodb/js/server/modules/@arangodb/foxx/templates/setup.js.tmpl

14 lines
452 B
Cheetah

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