Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const patchwork = require('./patchwork')
- sql.Promise = Promise;
- (async () => {
- try {
- console.log('Connecting to database...');
- const db = new Database();
- await db.init();
- for (let patch of patchwork) {
- if (typeof patch === 'string') {
- await db.exec(patch);
- } else if (typeof patch === 'function') {
- let script = await patch(db);
- if (typeof script === 'string' && script.length) {
- await db.exec(script);
- }
- }
- }
- console.log('Done!');
- process.exit(0);
- } catch (ex) {
- console.error(ex);
- process.exit(0);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement