Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@
const LEGACY_MODEL_VERSION = 'legacy-unversioned'

exports.up = async function up(knex) {
// Guard: skip if the milestone_embeddings table does not exist
// (e.g. when pgvector extension is unavailable and the table was never created).
const hasTable = await knex.schema.hasTable('milestone_embeddings')
if (!hasTable) return

await knex.schema.alterTable('milestone_embeddings', (table) => {
table.string('model_version', 128).notNullable().defaultTo(LEGACY_MODEL_VERSION)
})
}

exports.down = async function down(knex) {
const hasTable = await knex.schema.hasTable('milestone_embeddings')
if (!hasTable) return

await knex.schema.alterTable('milestone_embeddings', (table) => {
table.dropColumn('model_version')
})
Expand Down
2 changes: 1 addition & 1 deletion jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
],
},
setupFiles: ["<rootDir>/jest.setup.cjs"],
testMatch: ["**/tests/**/*.test.ts", "**/src/tests/**/*.test.ts", "**/src/repositories/**/*.test.ts"],
testMatch: ["**/tests/**/*.test.ts", "**/src/tests/**/*.test.ts", "**/src/services/**/*.test.ts", "**/src/repositories/**/*.test.ts"],
moduleDirectories: ["node_modules", "<rootDir>/node_modules"],
clearMocks: true,
};
Loading