2021-06-11 22:25:58 +03:00
|
|
|
import * as Logging from "~/common/logging";
|
|
|
|
|
2020-07-17 09:05:58 +03:00
|
|
|
import configs from "~/knexfile";
|
|
|
|
import knex from "knex";
|
|
|
|
|
|
|
|
const envConfig = configs["development"];
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
Logging.log(`SETUP: database`, envConfig);
|
2020-07-17 09:05:58 +03:00
|
|
|
|
|
|
|
const db = knex(envConfig);
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
Logging.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"),
|
2021-05-06 03:08:14 +03:00
|
|
|
db.schema.dropTable("slate_files"),
|
|
|
|
db.schema.dropTable("files"),
|
2020-11-17 10:50:08 +03:00
|
|
|
db.schema.dropTable("activity"),
|
|
|
|
db.schema.dropTable("subscriptions"),
|
|
|
|
db.schema.dropTable("keys"),
|
2021-03-07 23:53:54 +03:00
|
|
|
db.schema.dropTable("global"),
|
2020-11-17 10:44:47 +03:00
|
|
|
db.schema.dropTable("stats"),
|
2021-03-07 23:53:54 +03:00
|
|
|
db.schema.dropTable("deals"),
|
|
|
|
db.schema.dropTable("orphans"),
|
2021-05-19 05:58:14 +03:00
|
|
|
db.schema.dropTable("usage"),
|
2020-07-28 09:54:15 +03:00
|
|
|
]);
|
2020-07-17 09:05:58 +03:00
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
Logging.log(`FINISHED: drop-database.js`);
|
|
|
|
Logging.log(` CTRL +C to return to terminal.`);
|