remove new_... in tf
This commit is contained in:
parent
19cc787a4a
commit
77c22d0e55
@ -100,7 +100,7 @@ public class InsertTriggerGenerator {
|
||||
/**
|
||||
Grants ${rawSubTable} INSERT permission to specified role of new ${rawSuperTable} rows.
|
||||
*/
|
||||
create or replace function ${rawSubTableSchemaPrefix}new_${rawSubTableShortName}_grants_insert_to_${rawSuperTableShortName}_tf()
|
||||
create or replace function ${rawSubTableSchemaPrefix}${rawSubTableShortName}_grants_insert_to_${rawSuperTableShortName}_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -113,11 +113,11 @@ public class InsertTriggerGenerator {
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_${rawSubTableName}_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger ${rawSubTableName}_z_grants_after_insert_tg
|
||||
after insert on ${rawSuperTableWithSchema}
|
||||
for each row
|
||||
execute procedure ${rawSubTableSchemaPrefix}new_${rawSubTableShortName}_grants_insert_to_${rawSuperTableShortName}_tf();
|
||||
execute procedure ${rawSubTableSchemaPrefix}${rawSubTableShortName}_grants_insert_to_${rawSuperTableShortName}_tf();
|
||||
""",
|
||||
with("ifConditionThen", g.getSuperRoleDef().getEntityAlias().isCaseDependent()
|
||||
// TODO.impl: .type needs to be dynamically generated
|
||||
|
@ -104,7 +104,7 @@ $$;
|
||||
/**
|
||||
Grants rbactest.customer INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function rbactest.new_customer_grants_insert_to_global_tf()
|
||||
create or replace function rbactest.customer_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -117,11 +117,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_customer_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger customer_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure rbactest.new_customer_grants_insert_to_global_tf();
|
||||
execute procedure rbactest.customer_grants_insert_to_global_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -169,7 +169,7 @@ $$;
|
||||
/**
|
||||
Grants rbactest.package INSERT permission to specified role of new customer rows.
|
||||
*/
|
||||
create or replace function rbactest.new_package_grants_insert_to_customer_tf()
|
||||
create or replace function rbactest.package_grants_insert_to_customer_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -182,11 +182,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_package_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger package_z_grants_after_insert_tg
|
||||
after insert on rbactest.customer
|
||||
for each row
|
||||
execute procedure rbactest.new_package_grants_insert_to_customer_tf();
|
||||
execute procedure rbactest.package_grants_insert_to_customer_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -168,7 +168,7 @@ $$;
|
||||
/**
|
||||
Grants rbactest.domain INSERT permission to specified role of new package rows.
|
||||
*/
|
||||
create or replace function rbactest.new_domain_grants_insert_to_package_tf()
|
||||
create or replace function rbactest.domain_grants_insert_to_package_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -181,11 +181,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_domain_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger domain_z_grants_after_insert_tg
|
||||
after insert on rbactest.package
|
||||
for each row
|
||||
execute procedure rbactest.new_domain_grants_insert_to_package_tf();
|
||||
execute procedure rbactest.domain_grants_insert_to_package_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -178,7 +178,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.relation INSERT permission to specified role of new person rows.
|
||||
*/
|
||||
create or replace function hs_office.new_relation_grants_insert_to_person_tf()
|
||||
create or replace function hs_office.relation_grants_insert_to_person_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -191,11 +191,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_relation_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger relation_z_grants_after_insert_tg
|
||||
after insert on hs_office.person
|
||||
for each row
|
||||
execute procedure hs_office.new_relation_grants_insert_to_person_tf();
|
||||
execute procedure hs_office.relation_grants_insert_to_person_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -181,7 +181,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.partner INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function hs_office.new_partner_grants_insert_to_global_tf()
|
||||
create or replace function hs_office.partner_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -194,11 +194,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_partner_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger partner_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure hs_office.new_partner_grants_insert_to_global_tf();
|
||||
execute procedure hs_office.partner_grants_insert_to_global_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -85,7 +85,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.partner_details INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function hs_office.new_partner_details_grants_insert_to_global_tf()
|
||||
create or replace function hs_office.partner_details_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -98,11 +98,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_partner_details_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger partner_details_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure hs_office.new_partner_details_grants_insert_to_global_tf();
|
||||
execute procedure hs_office.partner_details_grants_insert_to_global_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -154,7 +154,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.debitor INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function hs_office.new_debitor_grants_insert_to_global_tf()
|
||||
create or replace function hs_office.debitor_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -167,11 +167,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_debitor_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger debitor_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure hs_office.new_debitor_grants_insert_to_global_tf();
|
||||
execute procedure hs_office.debitor_grants_insert_to_global_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -129,7 +129,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.sepamandate INSERT permission to specified role of new relation rows.
|
||||
*/
|
||||
create or replace function hs_office.new_sepamandate_grants_insert_to_relation_tf()
|
||||
create or replace function hs_office.sepamandate_grants_insert_to_relation_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -142,11 +142,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_sepamandate_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger sepamandate_z_grants_after_insert_tg
|
||||
after insert on hs_office.relation
|
||||
for each row
|
||||
execute procedure hs_office.new_sepamandate_grants_insert_to_relation_tf();
|
||||
execute procedure hs_office.sepamandate_grants_insert_to_relation_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -116,7 +116,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.membership INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function hs_office.new_membership_grants_insert_to_global_tf()
|
||||
create or replace function hs_office.membership_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -129,11 +129,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_membership_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger membership_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure hs_office.new_membership_grants_insert_to_global_tf();
|
||||
execute procedure hs_office.membership_grants_insert_to_global_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -92,7 +92,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.coopsharetx INSERT permission to specified role of new membership rows.
|
||||
*/
|
||||
create or replace function hs_office.new_coopsharetx_grants_insert_to_membership_tf()
|
||||
create or replace function hs_office.coopsharetx_grants_insert_to_membership_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -105,11 +105,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_coopsharetx_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger coopsharetx_z_grants_after_insert_tg
|
||||
after insert on hs_office.membership
|
||||
for each row
|
||||
execute procedure hs_office.new_coopsharetx_grants_insert_to_membership_tf();
|
||||
execute procedure hs_office.coopsharetx_grants_insert_to_membership_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -92,7 +92,7 @@ $$;
|
||||
/**
|
||||
Grants hs_office.coopassettx INSERT permission to specified role of new membership rows.
|
||||
*/
|
||||
create or replace function hs_office.new_coopassettx_grants_insert_to_membership_tf()
|
||||
create or replace function hs_office.coopassettx_grants_insert_to_membership_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -105,11 +105,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_coopassettx_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger coopassettx_z_grants_after_insert_tg
|
||||
after insert on hs_office.membership
|
||||
for each row
|
||||
execute procedure hs_office.new_coopassettx_grants_insert_to_membership_tf();
|
||||
execute procedure hs_office.coopassettx_grants_insert_to_membership_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -123,7 +123,7 @@ $$;
|
||||
/**
|
||||
Grants hs_booking.project INSERT permission to specified role of new relation rows.
|
||||
*/
|
||||
create or replace function hs_booking.new_project_grants_insert_to_relation_tf()
|
||||
create or replace function hs_booking.project_grants_insert_to_relation_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -136,11 +136,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_project_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger project_z_grants_after_insert_tg
|
||||
after insert on hs_office.relation
|
||||
for each row
|
||||
execute procedure hs_booking.new_project_grants_insert_to_relation_tf();
|
||||
execute procedure hs_booking.project_grants_insert_to_relation_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -122,7 +122,7 @@ $$;
|
||||
/**
|
||||
Grants hs_booking.item INSERT permission to specified role of new global rows.
|
||||
*/
|
||||
create or replace function hs_booking.new_item_grants_insert_to_global_tf()
|
||||
create or replace function hs_booking.item_grants_insert_to_global_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -135,11 +135,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_item_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger item_z_grants_after_insert_tg
|
||||
after insert on rbac.global
|
||||
for each row
|
||||
execute procedure hs_booking.new_item_grants_insert_to_global_tf();
|
||||
execute procedure hs_booking.item_grants_insert_to_global_tf();
|
||||
|
||||
-- granting INSERT permission to hs_booking.project ----------------------------
|
||||
|
||||
@ -165,7 +165,7 @@ $$;
|
||||
/**
|
||||
Grants hs_booking.item INSERT permission to specified role of new project rows.
|
||||
*/
|
||||
create or replace function hs_booking.new_item_grants_insert_to_project_tf()
|
||||
create or replace function hs_booking.item_grants_insert_to_project_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -178,11 +178,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_item_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger item_z_grants_after_insert_tg
|
||||
after insert on hs_booking.project
|
||||
for each row
|
||||
execute procedure hs_booking.new_item_grants_insert_to_project_tf();
|
||||
execute procedure hs_booking.item_grants_insert_to_project_tf();
|
||||
|
||||
-- granting INSERT permission to hs_booking.item ----------------------------
|
||||
|
||||
@ -192,7 +192,7 @@ execute procedure hs_booking.new_item_grants_insert_to_project_tf();
|
||||
/**
|
||||
Grants hs_booking.item INSERT permission to specified role of new item rows.
|
||||
*/
|
||||
create or replace function hs_booking.new_item_grants_insert_to_item_tf()
|
||||
create or replace function hs_booking.item_grants_insert_to_item_tf()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
strict as $$
|
||||
@ -205,11 +205,11 @@ begin
|
||||
return NEW;
|
||||
end; $$;
|
||||
|
||||
-- z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger z_new_item_grants_after_insert_tg
|
||||
-- ..._z_... is to put it at the end of after insert triggers, to make sure the roles exist
|
||||
create trigger item_z_grants_after_insert_tg
|
||||
after insert on hs_booking.item
|
||||
for each row
|
||||
execute procedure hs_booking.new_item_grants_insert_to_item_tf();
|
||||
execute procedure hs_booking.item_grants_insert_to_item_tf();
|
||||
|
||||
|
||||
-- ============================================================================
|
||||
|
@ -7,7 +7,7 @@ spring:
|
||||
url-tc: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers
|
||||
url-tcx: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers?TC_REUSABLE=true&TC_DAEMON=true
|
||||
url-local: jdbc:postgresql://localhost:5432/postgres
|
||||
url: ${spring.datasource.url-local}
|
||||
url: ${spring.datasource.url-tc}
|
||||
username: postgres
|
||||
password: password
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user