1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-27 04:58:40 +09:00
MisskeyIO/src/tools/accept-migration.ts

26 lines
642 B
TypeScript
Raw Normal View History

2019-06-30 04:49:30 +09:00
// ex) node built/tools/accept-migration Yo 1000000000001
import { createConnection } from 'typeorm';
2021-03-23 17:43:07 +09:00
import config from '@/config';
2019-06-30 04:49:30 +09:00
createConnection({
type: 'postgres',
host: config.db.host,
port: config.db.port,
username: config.db.user,
password: config.db.pass,
database: config.db.db,
extra: config.db.extra,
synchronize: false,
dropSchema: false,
}).then(c => {
c.query(`INSERT INTO migrations(timestamp,name) VALUES (${process.argv[3]}, '${process.argv[2]}${process.argv[3]}');`).then(() => {
console.log('done');
process.exit(0);
}).catch(e => {
console.log('ERROR:');
console.log(e);
process.exit(1);
});
});