Skip to content
Merged
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
5 changes: 4 additions & 1 deletion server/src/repositories/database.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ export class DatabaseRepository {
return;
}
const dimSize = await this.getDimensionSize(table);
await sql`DROP INDEX IF EXISTS ${sql.raw(indexName)}`.execute(this.db);
await this.db.schema.dropIndex(indexName).ifExists().execute();
if (table === 'smart_search') {
await this.db.schema.alterTable(table).dropConstraint('dim_size_constraint').ifExists().execute();
}
await this.db.transaction().execute(async (tx) => {
if (!rows.some((row) => row.columnName === 'embedding')) {
this.logger.warn(`Column 'embedding' does not exist in table '${table}', truncating and adding column.`);
Expand Down
Loading