Add scripts

This commit is contained in:
kngako
2022-06-19 01:35:10 +02:00
parent 29aa196eac
commit 3f7a120600
3 changed files with 271 additions and 0 deletions

20
scripts/init-license.js Normal file
View 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)
})
})