mirror of
https://fast.feibisi.com/https://github.com/parcelvoy/platform.git
synced 2025-08-29 11:56:04 +08:00
Fixes path for migrations in production (#196)
This commit is contained in:
parent
87b052e117
commit
4ab6050831
1 changed files with 7 additions and 1 deletions
|
@ -55,7 +55,13 @@ const migrate = async (config: DatabaseConfig, db: Database, fresh = false) => {
|
|||
|
||||
// Run migrations
|
||||
return db.migrate.latest({
|
||||
directory: [path.resolve(__dirname, '../../db/migrations'), ...config.migrationPaths],
|
||||
directory: [
|
||||
path.resolve(__dirname, process.env.NODE_ENV === 'production'
|
||||
? '../db/migrations'
|
||||
: '../../db/migrations',
|
||||
),
|
||||
...config.migrationPaths,
|
||||
],
|
||||
tableName: 'migrations',
|
||||
loadExtensions: ['.js', '.ts'],
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue