mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix(server): filter parameters by database and role (#19392)
This commit is contained in:
parent
ecc58a8971
commit
03966146fe
1 changed files with 5 additions and 1 deletions
|
|
@ -2,7 +2,11 @@ import { Kysely, sql } from 'kysely';
|
|||
|
||||
export async function up(qb: Kysely<any>): Promise<void> {
|
||||
type Conf = { db: string; guc: string[] };
|
||||
const res = await sql<Conf>`select current_database() db, to_json(setconfig) guc from pg_db_role_setting`.execute(qb);
|
||||
const res = await sql<Conf>`
|
||||
select current_database() db, to_json(setconfig) guc
|
||||
from pg_db_role_setting
|
||||
where setdatabase = (select oid from pg_database where datname = current_database())
|
||||
and setrole = 0;`.execute(qb);
|
||||
if (res.rows.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue