fix(api): don't crash if not superuser (#1133)

This commit is contained in:
Antoine
2025-11-03 12:34:30 +01:00
committed by GitHub
parent 3e7b27342c
commit d98ac3b452
+7 -3
View File
@@ -116,13 +116,17 @@ export const db = drizzle({
});
export const migrate = async () => {
await db.execute(
sql.raw(`
try {
await db.execute(
sql.raw(`
create extension if not exists pg_trgm;
SET pg_trgm.word_similarity_threshold = 0.4;
ALTER DATABASE "${postgresConfig.database}" SET pg_trgm.word_similarity_threshold = 0.4;
`),
);
);
} catch (err: any) {
console.error("Error while updating pg_trgm", err.message);
}
await migrateDb(db, {
migrationsSchema: "kyoo",
migrationsFolder: "./drizzle",