mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix(server): filter parameters by database and role (#19392)
This commit is contained in:
parent
ecc58a8971
commit
03966146fe
@ -2,7 +2,11 @@ import { Kysely, sql } from 'kysely';
|
|||||||
|
|
||||||
export async function up(qb: Kysely<any>): Promise<void> {
|
export async function up(qb: Kysely<any>): Promise<void> {
|
||||||
type Conf = { db: string; guc: string[] };
|
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) {
|
if (res.rows.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user