2020-07-17 09:05:58 +03:00
|
|
|
import configs from "~/knexfile";
|
|
|
|
import knex from "knex";
|
|
|
|
|
|
|
|
const envConfig = configs["development"];
|
|
|
|
|
|
|
|
console.log(`SETUP: database`, envConfig);
|
|
|
|
|
|
|
|
const db = knex(envConfig);
|
|
|
|
|
2020-07-28 09:54:15 +03:00
|
|
|
console.log(`RUNNING: drop-database.js`);
|
2020-07-17 09:05:58 +03:00
|
|
|
|
2020-07-28 09:54:15 +03:00
|
|
|
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"),
|
2020-07-28 09:54:15 +03:00
|
|
|
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")
|
2020-07-28 09:54:15 +03:00
|
|
|
]);
|
2020-07-17 09:05:58 +03:00
|
|
|
|
|
|
|
console.log(`FINISHED: drop-database.js`);
|
|
|
|
console.log(` CTRL +C to return to terminal.`);
|