mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix create extension place (move out of migration)
This commit is contained in:
parent
7fb23bb490
commit
b18ab07e3e
@ -4,7 +4,7 @@
|
||||
# either an hard-coded secret to decode jwts or empty to use keibi's public secret.
|
||||
# this should only be used in tests
|
||||
JWT_SECRET=
|
||||
# keibi's server to retrive the public jwt secret
|
||||
# keibi's server to retrieve the public jwt secret
|
||||
AUHT_SERVER=http://auth:4568
|
||||
|
||||
POSTGRES_USER=kyoo
|
||||
|
@ -1,5 +1,3 @@
|
||||
create extension if not exists pg_trgm;
|
||||
|
||||
CREATE INDEX "name_trgm" ON "kyoo"."show_translations" USING gin ("name" gin_trgm_ops);--> statement-breakpoint
|
||||
CREATE INDEX "tags" ON "kyoo"."show_translations" USING btree ("tags");--> statement-breakpoint
|
||||
CREATE INDEX "kind" ON "kyoo"."shows" USING hash ("kind");--> statement-breakpoint
|
||||
|
@ -6,7 +6,7 @@ import * as schema from "./schema";
|
||||
const dbConfig = {
|
||||
user: process.env.POSTGRES_USER ?? "kyoo",
|
||||
password: process.env.POSTGRES_PASSWORD ?? "password",
|
||||
database: process.env.POSTGRES_DB ?? "kyooDB",
|
||||
database: process.env.POSTGRES_DB ?? "kyoo",
|
||||
host: process.env.POSTGRES_SERVER ?? "postgres",
|
||||
port: Number(process.env.POSTGRES_PORT) || 5432,
|
||||
ssl: false,
|
||||
@ -19,9 +19,10 @@ export const db = drizzle({
|
||||
|
||||
export const migrate = async () => {
|
||||
await db.execute(
|
||||
sql.raw(
|
||||
`ALTER DATABASE "${dbConfig.database}" SET pg_trgm.word_similarity_threshold = 0.4;`,
|
||||
),
|
||||
sql.raw(`
|
||||
create extension if not exists pg_trgm;
|
||||
ALTER DATABASE "${dbConfig.database}" SET pg_trgm.word_similarity_threshold = 0.4;
|
||||
`),
|
||||
);
|
||||
await migrateDb(db, {
|
||||
migrationsSchema: "kyoo",
|
||||
|
Loading…
x
Reference in New Issue
Block a user