Skip to content

Commit ac3943a

Browse files
authored
Merge pull request #752 from constructive-io/devin/1772239125-grantee-name-upstream
fix: update @pgpmjs/core export config for grantee_name rename and add default_privilege table
2 parents ce2369c + 4fcc147 commit ac3943a

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

pgpm/core/src/export/export-meta.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ const config: Record<string, TableConfig> = {
161161
database_id: 'uuid',
162162
table_id: 'uuid',
163163
name: 'text',
164-
role_name: 'text',
164+
grantee_name: 'text',
165165
privilege: 'text',
166166
permissive: 'boolean',
167167
disabled: 'boolean',
@@ -338,8 +338,22 @@ const config: Record<string, TableConfig> = {
338338
database_id: 'uuid',
339339
table_id: 'uuid',
340340
privilege: 'text',
341-
role_name: 'text',
342-
field_ids: 'uuid[]'
341+
grantee_name: 'text',
342+
field_ids: 'uuid[]',
343+
is_grant: 'boolean'
344+
}
345+
},
346+
default_privilege: {
347+
schema: 'metaschema_public',
348+
table: 'default_privilege',
349+
fields: {
350+
id: 'uuid',
351+
database_id: 'uuid',
352+
schema_id: 'uuid',
353+
object_type: 'text',
354+
privilege: 'text',
355+
grantee_name: 'text',
356+
is_grant: 'boolean'
343357
}
344358
},
345359
// =============================================================================
@@ -1026,6 +1040,7 @@ export const exportMeta = async ({ opts, dbname, database_id }: ExportMetaParams
10261040
await queryAndParse('full_text_search', `SELECT * FROM metaschema_public.full_text_search WHERE database_id = $1`);
10271041
await queryAndParse('schema_grant', `SELECT * FROM metaschema_public.schema_grant WHERE database_id = $1`);
10281042
await queryAndParse('table_grant', `SELECT * FROM metaschema_public.table_grant WHERE database_id = $1`);
1043+
await queryAndParse('default_privilege', `SELECT * FROM metaschema_public.default_privilege WHERE database_id = $1`);
10291044

10301045
// =============================================================================
10311046
// services_public tables

pgpm/core/src/export/export-migrations.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ SET session_replication_role TO DEFAULT;`;
378378
'full_text_search',
379379
'schema_grant',
380380
'table_grant',
381+
'default_privilege',
381382
'domains',
382383
'sites',
383384
'apis',

0 commit comments

Comments
 (0)