浏览代码

fix(create): Fix path for generated migrations

Michael Bromley 3 年之前
父节点
当前提交
f19c75c4d0
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      packages/create/templates/migration.hbs
  2. 1 1
      packages/create/templates/vendure-config.hbs

+ 1 - 1
packages/create/templates/migration.hbs

@@ -7,7 +7,7 @@ program
     .command('generate <name>')
     .command('generate <name>')
     .description('Generate a new migration file with the given name')
     .description('Generate a new migration file with the given name')
     .action(name => {
     .action(name => {
-        return generateMigration(config, { name, outputDir: './migrations' });
+        return generateMigration(config, { name, outputDir: './src/migrations' });
     });
     });
 
 
 program
 program

+ 1 - 1
packages/create/templates/vendure-config.hbs

@@ -46,7 +46,7 @@ export const config: VendureConfig = {
         // See the README.md "Migrations" section for an explanation of
         // See the README.md "Migrations" section for an explanation of
         // the `synchronize` and `migrations` options.
         // the `synchronize` and `migrations` options.
         synchronize: false,
         synchronize: false,
-        migrations: [path.join(__dirname, '../migrations/*.ts')],
+        migrations: [path.join(__dirname, './migrations/*.ts')],
         logging: false,
         logging: false,
         database: {{#if isSQLjs}}new Uint8Array([]){{else if isSQLite}}path.join(__dirname, '../vendure.sqlite'){{else}}process.env.DB_NAME{{/if}},
         database: {{#if isSQLjs}}new Uint8Array([]){{else if isSQLite}}path.join(__dirname, '../vendure.sqlite'){{else}}process.env.DB_NAME{{/if}},
         {{#if dbSchema}}
         {{#if dbSchema}}