slate/scripts/drop-database.js

28 lines
706 B
JavaScript
Raw Normal View History

import configs from "~/knexfile";
import knex from "knex";
const envConfig = configs["development"];
console.log(`SETUP: database`, envConfig);
const db = knex(envConfig);
console.log(`RUNNING: drop-database.js`);
Promise.all([
db.schema.dropTable("users"),
db.schema.dropTable("slates"),
2020-11-17 10:50:08 +03:00
db.schema.dropTable("pending"),
db.schema.dropTable("activity"),
db.schema.dropTable("trusted"),
db.schema.dropTable("subscriptions"),
db.schema.dropTable("keys"),
db.schema.dropTable("keys"),
2020-11-17 10:44:47 +03:00
db.schema.dropTable("stats"),
2020-11-17 10:50:08 +03:00
db.schema.dropTable('deals'),
2020-11-17 10:48:23 +03:00
db.schema.dropTable("orphans")
]);
console.log(`FINISHED: drop-database.js`);
console.log(` CTRL +C to return to terminal.`);