mirror of
https://github.com/paricafe/misskey.git
synced 2024-11-29 20:36:43 -06:00
b9cb6d1c10
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
25 lines
651 B
TypeScript
25 lines
651 B
TypeScript
// ex) node built/tools/accept-migration Yo 1000000000001
|
|
|
|
import { createConnection } from 'typeorm';
|
|
import config from '@/config/index.js';
|
|
|
|
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);
|
|
});
|
|
});
|