Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/301 foreign key constraint #302

Merged
merged 58 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b9a8845
#301 - Added ForeignKeyConstraintStatementProducer component (not yet…
starnowski Feb 20, 2024
f05eb5d
#301 - Added schema tests [skip ci]
starnowski Feb 21, 2024
b37188d
#301 - Creating of non_public_schema_with_composite_key schema
starnowski Feb 21, 2024
35f5bec
#301 - Tests refactoring
starnowski Feb 21, 2024
1e903e9
#301 - Added ForeignKeyConstraintStatementParameters [skip ci]
starnowski Feb 22, 2024
76db172
#301 - Added tests [skip ci]
starnowski Feb 23, 2024
1801247
#301 - Added tests [skip ci]
starnowski Feb 23, 2024
9d4fd48
#301 - Added generic tests
starnowski Feb 23, 2024
0f6113d
#301 - Added integration tests
starnowski Feb 24, 2024
9282a40
#301 - Code tests refactoring [skip ci]
starnowski Feb 24, 2024
2586470
#301 - Added usage of StepWise annotation in the tests
starnowski Feb 24, 2024
b532938
#301 - Tests code refactoring
starnowski Feb 24, 2024
0b7c417
#301 - Added createForeignKeyConstraintWithTenantColumn property. [sk…
starnowski Feb 24, 2024
0c78a73
#301 - Added tests [skip ci]
starnowski Feb 24, 2024
418b127
#301 - Added implementation for the IsRecordBelongsToCurrentTenantFun…
starnowski Feb 24, 2024
95c75a6
#301 - Added ignoreCreationOfConstraintThatChecksIfRecordBelongsToCur…
starnowski Feb 24, 2024
f0e9261
#301 - Added implementation for the ignoreCreationOfConstraintThatChe…
starnowski Feb 24, 2024
569e65a
#301 - Added implementation for the createForeignKeyConstraintWithTen…
starnowski Feb 24, 2024
2ce1e7e
#301 - Test code refactoring [skip ci]
starnowski Feb 24, 2024
5b408a2
#301 - Test code refactoring [skip ci]
starnowski Feb 24, 2024
299d8ce
#301 - Added tests [skip ci]
starnowski Feb 25, 2024
d2a71da
#301 - Added implementation for the ForeignKeyConstraintSQLDefinition…
starnowski Feb 25, 2024
9357555
#301 - Added tests [skip ci]
starnowski Feb 25, 2024
fdb0a9a
#301 - Added tests [skip ci]
starnowski Feb 26, 2024
3ab07cd
#301 - Added tests and implementation [skip ci]
starnowski Feb 26, 2024
6842779
#301 - Added tests and implementation [skip ci]
starnowski Feb 26, 2024
779a8e2
#301 - Added tests and implementation [skip ci]
starnowski Feb 26, 2024
5af424e
#301 - Added tests [skip ci]
starnowski Feb 26, 2024
41f230c
#301 - Added enricher to collection
starnowski Feb 26, 2024
9dd43be
#301 - Added abstract class for TestNg [skip ci]
starnowski Feb 27, 2024
005316c
#301 - Added e2e tests for schema with foreign key constraint
starnowski Feb 27, 2024
c8844c0
#301 - Added tests for the createForeignKeyConstraintWithTenantColumn…
starnowski Feb 27, 2024
1902fd3
#301 - Added READM.md entry [skip ci]
starnowski Feb 27, 2024
83d7060
#301 - Added READM.md entry [skip ci]
starnowski Feb 29, 2024
968cf36
#301 - Added READM.md entry [skip ci]
starnowski Feb 29, 2024
fcafc94
#301 - Added property and TODO comment [skip ci]
starnowski Mar 1, 2024
7dfde60
#301 - Added TODO comment [skip ci]
starnowski Mar 1, 2024
919d159
#301 - Added validation group resolvers (not yet finished!) [skip ci]
starnowski Mar 4, 2024
97daea3
#301 - Added validation group resolvers (not yet finished!) [skip ci]
starnowski Mar 5, 2024
93b8b09
#301 - Added tests for the validation group resolvers [skip ci]
starnowski Mar 5, 2024
75395b6
#301 - Added implementation for ValidatorGroupsResolver [skip ci]
starnowski Mar 5, 2024
8e925d7
#301 - Added tests case for NameForFunctionThatChecksIfRecordExistsIn…
starnowski Mar 5, 2024
7420227
#301 - Added implementation for NameForFunctionThatChecksIfRecordExis…
starnowski Mar 5, 2024
37e4af4
#301 - Added implementation for mapper [skip ci]
starnowski Mar 5, 2024
16f47d9
#301 - Added implementation for builder
starnowski Mar 5, 2024
336c806
#301 - Added test case and implementation [skip ci]
starnowski Mar 5, 2024
912318c
#301 - Added entry about create_foreignkey_constraint_with_tenant_col…
starnowski Mar 5, 2024
0d8f0c3
#301 - Fixed entry [skip ci]
starnowski Mar 5, 2024
aeba5a1
#301 - Fixed typo [skip ci]
starnowski Mar 6, 2024
bfa9cb2
#301 - Added entry to CHANGELOG.md [skip ci]
starnowski Mar 6, 2024
7e79d4c
#301 - Added entry to CHANGELOG.md [skip ci]
starnowski Mar 6, 2024
0934984
#301 - Added entry to CHANGELOG.md [skip ci]
starnowski Mar 6, 2024
f12a617
#301 - Added entry to CHANGELOG.md [skip ci]
starnowski Mar 6, 2024
ab23030
#301 - Added entry to CHANGELOG.md [skip ci]
starnowski Mar 6, 2024
c40ae89
#301 - Fixed asciidoc
starnowski Mar 6, 2024
55f4189
#301 - Changed package-lock.json
starnowski Mar 6, 2024
04f6ad3
Revert "#301 - Fixed asciidoc"
starnowski Mar 6, 2024
143a393
#301 - Fixed instruction document
starnowski Mar 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,27 @@ https://www.markdownguide.org/basic-syntax/

## [Unreleased]

### Added

- Add functionality that create foreign key instead of constraint that check if foreign key belongs to tenant [301](https://github.com/starnowski/posmulten/issues/301)
- Added property createForeignKeyConstraintWithTenantColumn in com.github.starnowski.posmulten.configuration.core.model.SharedSchemaContextConfiguration type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.configuration.yaml.model.PrimaryKeyDefinition.NameForFunctionThatChecksIfRecordExistsInTableNotBlank type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added property createForeignKeyConstraintWithTenantColumn in com.github.starnowski.posmulten.configuration.yaml.model.SharedSchemaContextConfiguration type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added getter and setter method for property createForeignKeyConstraintWithTenantColumn in com.github.starnowski.posmulten.configuration.yaml.model.SharedSchemaContextConfiguration type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.configuration.yaml.validation.groups.NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.configuration.yaml.validation.groups.ValidatorGroupResolver type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.configuration.yaml.validation.groups.ValidatorGroupsResolver type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.DefaultForeignKeyConstraintStatementParameters type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.ForeignKeyConstraintStatementProducer type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.IForeignKeyConstraintStatementParameters type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.context.DefaultSharedSchemaContextBuilder#setIgnoreCreationOfConstraintThatChecksIfRecordBelongsToCurrentTenant(Boolean) method. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.context.DefaultSharedSchemaContextBuilder#setCreateForeignKeyConstraintWithTenantColumn(Boolean) method. [301](https://github.com/starnowski/posmulten/issues/301)
- Added property createForeignKeyConstraintWithTenantColumn in com.github.starnowski.posmulten.postgresql.core.context.SharedSchemaContextRequest type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added property ignoreCreationOfConstraintThatChecksIfRecordBelongsToCurrentTenant in com.github.starnowski.posmulten.postgresql.core.context.SharedSchemaContextRequest type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added getter and setter method for property createForeignKeyConstraintWithTenantColumn in com.github.starnowski.posmulten.postgresql.core.context.SharedSchemaContextRequest type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added getter and setter method for property ignoreCreationOfConstraintThatChecksIfRecordBelongsToCurrentTenant in com.github.starnowski.posmulten.postgresql.core.context.SharedSchemaContextRequest type. [301](https://github.com/starnowski/posmulten/issues/301)
- Added com.github.starnowski.posmulten.postgresql.core.context.enrichers.ForeignKeyConstraintSQLDefinitionsEnricher type. [301](https://github.com/starnowski/posmulten/issues/301)

## [0.8.0] - 2023-11-20

### Added
Expand Down Expand Up @@ -74,7 +95,7 @@ https://www.markdownguide.org/basic-syntax/

### Added

- Added dectorator for sqlDefinitions that replace template value like {{schema}} to any passed value in all definitions [283](https://github.com/starnowski/posmulten/issues/283)
- Added decorator for sqlDefinitions that replace template value like {{schema}} to any passed value in all definitions [283](https://github.com/starnowski/posmulten/issues/283)
- Added com.github.starnowski.posmulten.configuration.jar.Constants type. [283](https://github.com/starnowski/posmulten/issues/283)
- Added com.github.starnowski.posmulten.configuration.jar.DDLScriptsGeneratorRunner type. [283](https://github.com/starnowski/posmulten/issues/283)
- Added com.github.starnowski.posmulten.configuration.jar.SystemPropertiesDefaultDecoratorContextSupplier type. [283](https://github.com/starnowski/posmulten/issues/283)
Expand Down
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
* [Setting function name that checks if passed identifier is the same as current tenant identifier](#setting-function-name-that-checks-if-passed-identifier-is-the-same-as-current-tenant-identifier)
* [Setting function name that checks if passed primary key for a specific table exists for the current tenant](#setting-function-name-that-checks-if-passed-primary-key-for-a-specific-table-exists-for-the-current-tenant)
* [Setting a list of invalid tenant identifier values](#setting-a-list-of-invalid-tenant-identifier-values)
* [Setting custom name for table tenant column constraint](#setting-custom-name-for-table-tenant-column-constraint)
* [Setting custom name for table tenant column constraint](#setting-custom-name-for-table-tenant-column-constraint)
* [Setting foreign key constraint where tenant column is part of composite key](#setting-foreign-key-constraint-where-tenant-column-is-part-of-composite-key)
* [Naming convention and its constraints](#naming-convention-and-its-constraints)
* [Adding custom sql definitions](#adding-custom-sql-definitions)
* [Using template variables in context builder](#using-template-variables-in-context-builder)
Expand Down Expand Up @@ -1109,6 +1110,39 @@ ALTER TABLE "users" ADD CONSTRAINT tenant_should_be_valid CHECK (tenant_id IS NU
ALTER TABLE "posts" ADD CONSTRAINT posts_tenant_is_valid CHECK (tenant_id IS NULL OR is_tenant_id_valid(tenant_id));
```

#### Setting foreign key constraint where tenant column is part of composite key
There might be a situation when your database model assumes that the tenant column is part of the table's primary key and, that being said, also part of the foreign keys.
This means that, for example, all your unique constraint has to cover tenant column value.
Having such a database model allows easier migration of tenant data between databases.
Below there is example how to specify such shared context object:
We have two tables, "users" and "notifications".

```java
DefaultSharedSchemaContextBuilder defaultSharedSchemaContextBuilder = new DefaultSharedSchemaContextBuilder(null);

// Setting flag with true value
defaultSharedSchemaContextBuilder.setCreateForeignKeyConstraintWithTenantColumn(true);

//....
// We have two tables, "users" and "notifications".
// Setting tables for which RLS should be created
defaultSharedSchemaContextBuilder.createRLSPolicyForTable("users", mapBuilder().put(("id", "bigint").build() , "tenant_id", "users_table_rls_policy");
defaultSharedSchemaContextBuilder.createRLSPolicyForTable("notifications", mapBuilder().put(("uuid", "uuid").build(), "notification_tenant", "notifications_table_rls_policy");

// Setting foreign key constraint declaration with method 'createSameTenantConstraintForForeignKey'
defaultSharedSchemaContextBuilder.createSameTenantConstraintForForeignKey("notification, "users", mapBuilder().put("user_id", "id").build(), "notification_users_fk");

// Setting a name for a function that checks if user record (reference table for our foreign key example) exists is not needed
//defaultSharedSchemaContextBuilder.setNameForFunctionThatChecksIfRecordExistsInTable("users", "is_user_belongs_to_current_tenant");
```

the builder will produce below statements:

```sql
ALTER TABLE IF EXISTS "notifications" ADD CONSTRAINT notification_users_fk FOREIGN KEY (notification_tenant, user_id) REFERENCES "users" (tenant_id, id) MATCH SIMPLE;
```


### Naming convention and its constraints
By default function name can have a length from 1 to 63 characters.
SQL definitions validation can be disabled by using method:
Expand Down
22 changes: 21 additions & 1 deletion bats/run_bats_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ export DATABASE_TESTS_SCHEMA_NAME="non_public_schema"
bats -rt "$SCRIPT_DIR/schema_structure"
DATABASE_TESTS_NON_PUBLIC_SCHEMA_RESULT="$?"

echo "Running schema structure tests for 'non_public_schema_with_composite_key' schema"
export DATABASE_TESTS_SCHEMA_NAME="non_public_schema_with_composite_key"
bats -rt "$SCRIPT_DIR/schema_structure"
DATABASE_TESTS_NON_PUBLIC_SCHEMA_COMPOSITE_KEY_RESULT="$?"

echo "Running schema keys tests for 'public' schema"
export DATABASE_TESTS_SCHEMA_NAME="public"
bats -rt "$SCRIPT_DIR/schema_keys"
DATABASE_TESTS_PUBLIC_SCHEMA_KEYS_RESULT="$?"

echo "Running schema keys tests for 'non_public_schema' schema"
export DATABASE_TESTS_SCHEMA_NAME="non_public_schema"
bats -rt "$SCRIPT_DIR/schema_keys"
DATABASE_TESTS_NON_PUBLIC_SCHEMA_KEYS_RESULT="$?"

echo "Running rls policy tests for 'public' schema"
export DATABASE_TESTS_SCHEMA_NAME="public"
bats -rt "$SCRIPT_DIR/rls_policy"
Expand All @@ -69,7 +84,12 @@ export DATABASE_TESTS_SCHEMA_NAME="non_public_schema"
bats -rt "$SCRIPT_DIR/rls_policy"
DATABASE_TESTS_NON_PUBLIC_RLS_RESULT="$?"

[[ $DATABASE_TESTS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_PUBLIC_SCHEMA_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_SCHEMA_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_PUBLIC_RLS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_RLS_RESULT -eq 0 ]]
echo "Running rls policy tests for 'non_public_schema_with_composite_key' schema"
export DATABASE_TESTS_SCHEMA_NAME="non_public_schema_with_composite_key"
bats -rt "$SCRIPT_DIR/rls_policy"
DATABASE_TESTS_NON_PUBLIC_SCHEMA_COMPOSITE_KEY_RLS_RESULT="$?"

[[ $DATABASE_TESTS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_PUBLIC_SCHEMA_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_SCHEMA_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_PUBLIC_SCHEMA_KEYS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_SCHEMA_KEYS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_PUBLIC_RLS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_RLS_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_SCHEMA_COMPOSITE_KEY_RESULT -eq 0 ]] && [[ $DATABASE_TESTS_NON_PUBLIC_SCHEMA_COMPOSITE_KEY_RLS_RESULT -eq 0 ]]

#
# TIPS!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public DefaultSharedSchemaContextBuilder enrich(DefaultSharedSchemaContextBuilde
if (contextConfiguration.getCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables() != null) {
builder.setCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables(contextConfiguration.getCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables());
}
builder.setCreateForeignKeyConstraintWithTenantColumn(contextConfiguration.getCreateForeignKeyConstraintWithTenantColumn());
validTenantValueConstraintConfigurationEnricher.enrich(builder, contextConfiguration.getValidTenantValueConstraint());
tablesEntriesEnricher.enrich(builder, contextConfiguration.getTables());
sqlDefinitionsValidationEnricher.enrich(builder, contextConfiguration.getSqlDefinitionsValidation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ public class SharedSchemaContextConfiguration {
private List<TableEntry> tables;
private SqlDefinitionsValidation sqlDefinitionsValidation;
private List<CustomDefinitionEntry> customDefinitions;
private Boolean createForeignKeyConstraintWithTenantColumn;
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,22 @@ class DefaultSharedSchemaContextBuilderConfigurationEnricherTest extends Abstrac
result == builder
1 * customDefinitionEntriesEnricher.enrich(builder, customDefinitions)
}

@Unroll
def "should set builder component with specific property createForeignKeyConstraintWithTenantColumn with value #createForeignKeyConstraintWithTenantColumn"()
{
given:
def builder = prepareBuilderMockWithZeroExpectationOfMethodsInvocation()
def configuration = new SharedSchemaContextConfiguration().setCreateForeignKeyConstraintWithTenantColumn(createForeignKeyConstraintWithTenantColumn)

when:
def result = tested.enrich(builder, configuration)

then:
result == builder
1 * builder.setCreateForeignKeyConstraintWithTenantColumn(createForeignKeyConstraintWithTenantColumn)

where:
createForeignKeyConstraintWithTenantColumn << [null, false, true]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,18 @@ tables:

## Root properties

| Property name | Type | Required | Nullable | Description |
|---------------|-----------|---------------|---------------|---------------|
|#default_schema | String | Yes | Yes | Name of the database schema for which changes should be applied. |
|#current_tenant_id_property_type | String | No | No | Type of column that stores tenant identifier and it is also the type of parameters for some generated functions. |
|#current_tenant_id_property | String | No | No | Property name that stores the value of tenant identifier in the database connection. |
|#get_current_tenant_id_function_name | String | No | No | Name of the function that returns the current tenant identifier. |
|#set_current_tenant_id_function_name | String | No | No | Name of the function that sets the current tenant identifier. |
|#tenant_has_authorities_function_name | String | No | No | Name of the function name that checks if the current tenant has authority to a table row. |
|#force_row_level_security_for_table_owner | Boolean | No | Yes | Option that force RLS policy for table owner. |
|#default_tenant_id_column | String | No | No | Default name of column that stores tenant identifier. |
|#grantee | String | Yes | No | Database user for which RLS policy is going to be created. |
| Property name | Type | Required | Nullable | Description |
|---------------|-----------|---------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|#default_schema | String | Yes | Yes | Name of the database schema for which changes should be applied. |
|#current_tenant_id_property_type | String | No | No | Type of column that stores tenant identifier and it is also the type of parameters for some generated functions. |
|#current_tenant_id_property | String | No | No | Property name that stores the value of tenant identifier in the database connection. |
|#get_current_tenant_id_function_name | String | No | No | Name of the function that returns the current tenant identifier. |
|#set_current_tenant_id_function_name | String | No | No | Name of the function that sets the current tenant identifier. |
|#tenant_has_authorities_function_name | String | No | No | Name of the function name that checks if the current tenant has authority to a table row. |
|#force_row_level_security_for_table_owner | Boolean | No | Yes | Option that force RLS policy for table owner. |
|#default_tenant_id_column | String | No | No | Default name of column that stores tenant identifier. |
|#grantee | String | Yes | No | Database user for which RLS policy is going to be created. |
|#create_foreignkey_constraint_with_tenant_column | Boolean | No | Yes | Create the foreign key constraint that tenant column is part of composite key. Instead of function that check if reference key exist for specific tenant. |

| Property name | Type | Required | Nullable | Description |
|---------------|-----------|---------------|---------------|---------------|
Expand Down Expand Up @@ -145,10 +146,10 @@ The rls\_policy entry is required to specify the RLS policy for table.

### primary_key_definition

| Property name | Type | Required | Nullable | Description |
|---------------|-----------|---------------|---------------|---------------|
|#pk_columns_name_to_type | Map | No | Yes | Map of primary key columns where the key is column name and value is its type |
|#name_for_function_that_checks_if_record_exists_in_table | String | Yes | No | Function name that checks if passed primary key for a specific table exists for the current tenant |
| Property name | Type | Required | Nullable | Description |
|---------------|-----------|------------------------------------------------------------------------------------------------------------------------------|---------------|---------------|
|#pk_columns_name_to_type | Map | No | Yes | Map of primary key columns where the key is column name and value is its type |
|#name_for_function_that_checks_if_record_exists_in_table | String | if flag #create_foreignkey_constraint_with_tenant_column is null or false | Yes | Function name that checks if passed primary key for a specific table exists for the current tenant |

### foreign_keys

Expand Down Expand Up @@ -436,6 +437,19 @@ grantee: "application-user"

For more information please check https://github.com/starnowski/posmulten#setting-default-database-user-for-rls-policy.

### create_foreignkey_constraint_with_tenant_column

Create the foreign key constraint that tenant column is part of composite key.
Instead of function that check if reference key exist for specific tenant.

Example:

```yaml
create_foreignkey_constraint_with_tenant_column: true
```

For more information please check https://github.com/starnowski/posmulten#setting-foreign-key-constraint-where-tenant-column-is-part-of-composite-key.

### set_current_tenant_identifier_as_default_value_for_tenant_column_in_all_tables

Generate a statement that sets a default value for the tenant column in all tables.
Expand Down Expand Up @@ -518,6 +532,7 @@ This is a valid case for example for a many-to-many relation table without any p

Function name that checks if passed primary key for a specific table exists for the current tenant.
This function is generated only when some other table has a #foreign_keys that refers to the primary key table.
if flag #create_foreignkey_constraint_with_tenant_column is null or false then value is mandatory.

For more information please check:

Expand Down
Loading
Loading