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

Standardize the behavior of entity creation #294

Open
artpdr opened this issue Feb 9, 2022 · 0 comments
Open

Standardize the behavior of entity creation #294

artpdr opened this issue Feb 9, 2022 · 0 comments

Comments

@artpdr
Copy link
Collaborator

artpdr commented Feb 9, 2022

When we create a new entity, we can define a column to have a UNIQUE constraint and also to have an explicit Index in Postgres. However, if we use oracle, the code will crash. We can either have a UNIQUE constraint on the column or an explicit Index as Oracle and most of the relational databases automatically create an index for columns with UNIQUE constraints. As PDB is supposed to have the same behavior with all DBs, when we have an Index and UNIQUE constraint defined for the same column, we should fail fast or handle this situation by ensuring that when a UNIQUE constraint is created, then one and only one Index is present for that column.

Another problem that may happen with entity creation is when we have a foreign key (FK) referencing another table and the FK column is a STRING without size defined. This will be a problem in SQL Server. A possible solution here may be to check the column size of the referenced column and add the same size to the FK column. This must be done for all DB Engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant