mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 02:27:11 -04:00 
			
		
		
		
	Fix pg_trgm word similarly threshold even for the first session
This commit is contained in:
		
							parent
							
								
									1bca9f47dd
								
							
						
					
					
						commit
						9b526461c6
					
				
							
								
								
									
										7
									
								
								.github/workflows/api-test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								.github/workflows/api-test.yml
									
									
									
									
										vendored
									
									
								
							| @ -38,10 +38,3 @@ jobs: | ||||
|         env: | ||||
|           JWT_SECRET: "TODO" | ||||
|           POSTGRES_SERVER: localhost | ||||
| 
 | ||||
|       - uses: actions/upload-artifact@v4 | ||||
|         with: | ||||
|           name: results | ||||
|           path: auth/out | ||||
| 
 | ||||
| 
 | ||||
|  | ||||
| @ -5,7 +5,8 @@ | ||||
| 		"dev": "bun --watch src/index.ts", | ||||
| 		"build": "bun build src/index.ts --target bun --outdir ./dist", | ||||
| 		"start": "NODE_ENV=production bun dist/index.js", | ||||
| 		"test": "bun test" | ||||
| 		"test": "bun test", | ||||
| 		"format": "biome check --write ." | ||||
| 	}, | ||||
| 	"dependencies": { | ||||
| 		"@elysiajs/jwt": "^1.2.0", | ||||
|  | ||||
| @ -21,6 +21,7 @@ export const migrate = async () => { | ||||
| 	await db.execute( | ||||
| 		sql.raw(` | ||||
| 			create extension if not exists pg_trgm; | ||||
| 			SET pg_trgm.word_similarity_threshold = 0.4; | ||||
| 			ALTER DATABASE "${dbConfig.database}" SET pg_trgm.word_similarity_threshold = 0.4; | ||||
| 		`),
 | ||||
| 	); | ||||
| @ -28,4 +29,5 @@ export const migrate = async () => { | ||||
| 		migrationsSchema: "kyoo", | ||||
| 		migrationsFolder: "./drizzle", | ||||
| 	}); | ||||
| 	console.log(`Database ${dbConfig.database} migrated!`); | ||||
| }; | ||||
|  | ||||
| @ -309,6 +309,7 @@ describe("search", () => { | ||||
| 		const [resp, body] = await getMovies({ | ||||
| 			limit: 2, | ||||
| 			query: "bobble", | ||||
| 			langs: "en", | ||||
| 		}); | ||||
| 
 | ||||
| 		expectStatus(resp, body).toBe(200); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user