Просмотр исходного кода

refactor(@growi/app): rename migration cli

mizozobu 2 недель назад
Родитель
Сommit
882179ece9
2 измененных файлов с 8 добавлено и 2 удалено
  1. 7 1
      apps/app/bin/migrate.ts
  2. 1 1
      apps/app/tsconfig.json

+ 7 - 1
apps/app/prisma/index.ts → apps/app/bin/migrate.ts

@@ -1,3 +1,9 @@
+/**
+ * umzug cli
+ *
+ * Usage:
+ *   pnpm ts-node bin/migrate.ts
+ */
 import { resolve } from 'node:path';
 import { config } from 'dotenv-flow';
 import { MongoClient } from 'mongodb';
@@ -16,7 +22,7 @@ config();
   await client.connect();
 
   const umzug = new Umzug({
-    migrations: { glob: resolve(__dirname, 'migrations/*.(ts|js)') },
+    migrations: { glob: resolve(__dirname, '../prisma/migrations/*.(ts|js)') },
     context: prisma,
     storage: new MongoDBStorage({
       connection: client.db(),

+ 1 - 1
apps/app/tsconfig.json

@@ -26,7 +26,7 @@
       { "transform": "typescript-transform-paths", "afterDeclarations": true }
     ]
   },
-  "include": ["next-env.d.ts", "config", "prisma", "src"],
+  "include": ["next-env.d.ts", "bin", "config", "prisma", "src"],
   "exclude": ["src/**/*.vendor-styles.*"],
   "ts-node": {
     "transpileOnly": true,