2020-07-17 09:05:58 +03:00
|
|
|
import configs from "~/knexfile";
|
|
|
|
import knex from "knex";
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
import * as Logging from "~/common/logging";
|
|
|
|
|
2020-07-17 09:05:58 +03:00
|
|
|
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: setup-database.js`);
|
2020-07-17 09:05:58 +03:00
|
|
|
|
|
|
|
Promise.all([db.raw('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"')]);
|
|
|
|
|
2021-06-11 22:25:58 +03:00
|
|
|
Logging.log(`FINISHED: setup-database.js`);
|
|
|
|
Logging.log(` CTRL +C to return to terminal.`);
|