Chg: tsxをdevDependenciesに移動 / Del: MikroORM公式CLIを廃止 / Feat: scriptsのmigrator

This commit is contained in:
2026-03-27 22:53:18 +09:00
parent d66ab803bc
commit 6b54ae4306
6 changed files with 359 additions and 17 deletions
+23
View File
@@ -0,0 +1,23 @@
import config from "../dist/mikro-orm.config.js";
import { MikroORM } from "@mikro-orm/postgresql";
const orm = await MikroORM.init({
...config,
logger: (msg) => console.log(msg),
});
switch (process.argv[2]) {
case "up":
await orm.migrator.up();
break;
case "down":
await orm.migrator.down();
break;
case "create":
await orm.migrator.createMigration();
break;
default:
console.log("Only the options up, down, and create are available.");
}
process.exit();