slate/scripts/drop-database.js

32 lines
821 B
JavaScript
Raw 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"),
2021-05-25 01:19:48 +03:00
db.schema.dropTable("likes"),
]);
Logging.log(`FINISHED: drop-database.js`);
Logging.log(` CTRL +C to return to terminal.`);