Add scripts
This commit is contained in:
20
scripts/init-license.js
Normal file
20
scripts/init-license.js
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user