slate/scripts/drop-database.js

31 lines
789 B
JavaScript
Raw Permalink Normal View History

import * as Logging from "~/common/logging";
import configs from "~/knexfile";
import knex from "knex";
const envConfig = configs["development"];
Logging.log(`SETUP: database`, envConfig);
const db = knex(envConfig);
Logging.log(`RUNNING: drop-database.js`);
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"),
db.schema.dropTable("global"),
2020-11-17 10:44:47 +03:00
db.schema.dropTable("stats"),
db.schema.dropTable("deals"),
db.schema.dropTable("orphans"),
db.schema.dropTable("usage"),
]);
Logging.log(`FINISHED: drop-database.js`);
Logging.log(` CTRL +C to return to terminal.`);