From e150c2ff0077f12ecaebdaf8ad00210d2b035363 Mon Sep 17 00:00:00 2001 From: Jake Bromberg Date: Sat, 21 Feb 2026 08:26:49 -0800 Subject: [PATCH 1/2] fix: correct migrations folder path in migration_script.mjs The script referenced 'src/db/migrations' which doesn't exist. Updated to the correct relative path. Co-authored-by: Cursor --- .../src/migrations/migration_script.mjs | 2 +- .../database/migration-script-path.test.ts | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/unit/database/migration-script-path.test.ts diff --git a/shared/database/src/migrations/migration_script.mjs b/shared/database/src/migrations/migration_script.mjs index 7ec301ca..098765b0 100644 --- a/shared/database/src/migrations/migration_script.mjs +++ b/shared/database/src/migrations/migration_script.mjs @@ -15,6 +15,6 @@ const migrationClient = postgres( const db = drizzle(migrationClient); -migrate(db, { migrationsFolder: 'src/db/migrations' }) +migrate(db, { migrationsFolder: 'shared/database/src/migrations' }) .catch((e) => console.error(e)) .then(() => console.log('MIGRATION COMPLETE!')); diff --git a/tests/unit/database/migration-script-path.test.ts b/tests/unit/database/migration-script-path.test.ts new file mode 100644 index 00000000..922f89d2 --- /dev/null +++ b/tests/unit/database/migration-script-path.test.ts @@ -0,0 +1,26 @@ +import * as fs from 'fs'; +import * as path from 'path'; + +const MIGRATION_SCRIPT_PATH = path.resolve( + __dirname, + '../../../shared/database/src/migrations/migration_script.mjs' +); + +const EXPECTED_MIGRATIONS_FOLDER = 'shared/database/src/migrations'; + +describe('migration_script.mjs', () => { + it('should reference the correct migrations folder path', () => { + const content = fs.readFileSync(MIGRATION_SCRIPT_PATH, 'utf-8'); + const match = content.match(/migrationsFolder:\s*['"]([^'"]+)['"]/); + expect(match).not.toBeNull(); + + const migrationsFolder = match![1]; + expect(migrationsFolder).toBe(EXPECTED_MIGRATIONS_FOLDER); + }); + + it('should point to a directory that exists relative to the workspace root', () => { + const workspaceRoot = path.resolve(__dirname, '../../..'); + const resolvedPath = path.resolve(workspaceRoot, EXPECTED_MIGRATIONS_FOLDER); + expect(fs.existsSync(resolvedPath)).toBe(true); + }); +}); From 26b178f229c565ab5f716eea973f6642a915837a Mon Sep 17 00:00:00 2001 From: Jake Bromberg Date: Fri, 27 Feb 2026 10:07:43 -0800 Subject: [PATCH 2/2] fix: resolve lint errors --- tests/unit/database/migration-script-path.test.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/unit/database/migration-script-path.test.ts b/tests/unit/database/migration-script-path.test.ts index 922f89d2..6a63a309 100644 --- a/tests/unit/database/migration-script-path.test.ts +++ b/tests/unit/database/migration-script-path.test.ts @@ -1,10 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; -const MIGRATION_SCRIPT_PATH = path.resolve( - __dirname, - '../../../shared/database/src/migrations/migration_script.mjs' -); +const MIGRATION_SCRIPT_PATH = path.resolve(__dirname, '../../../shared/database/src/migrations/migration_script.mjs'); const EXPECTED_MIGRATIONS_FOLDER = 'shared/database/src/migrations'; @@ -14,7 +11,7 @@ describe('migration_script.mjs', () => { const match = content.match(/migrationsFolder:\s*['"]([^'"]+)['"]/); expect(match).not.toBeNull(); - const migrationsFolder = match![1]; + const migrationsFolder = match[1]; expect(migrationsFolder).toBe(EXPECTED_MIGRATIONS_FOLDER); });