Files
mantra.press/scripts/init-license.js

21 lines
528 B
JavaScript
Raw Normal View History

2022-06-19 01:35:10 +02:00
const db = require('mantra-db-models');
const prompt = require("prompt")
db.init().then(() => {
// We could probably run the things in the seeders...
db.License.findAll()
.then(licenses => {
if (licenses.length == 0) {
// TODO: Create languages
return db.License.create({
id: "copyright",
name: "Copyright"
})
} else {
return licenses
}
}).catch(error => {
console.error("Error: ", error)
})
})