T-2: M0.2 — Finish shared Postgres migrations: bun run db:migrate + fresh-database schema test
This commit is contained in:
parent
861ac72be0
commit
c2db2d7495
1 changed files with 3 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { mkdtempSync, rmSync } from 'node:fs';
|
||||
import { mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||
|
|
@ -149,6 +149,8 @@ function runInitInIsolatedSubprocess(
|
|||
mode: 'load-and-resolve' | 'load-only' = 'load-and-resolve'
|
||||
): { exitCode: number; stdout: string; stderr: string } {
|
||||
const isolatedDir = mkdtempSync(join(tmpdir(), 'stock-bot-db-migrate-env-'));
|
||||
// Stop the config loader's upward .env search inside the temp directory.
|
||||
writeFileSync(join(isolatedDir, '.env'), '', 'utf8');
|
||||
const script =
|
||||
mode === 'load-only'
|
||||
? `import { loadMigrationConfig } from ${JSON.stringify(dbMigrateModuleUrl)};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue