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

new natural primary key scheme #18

Merged
merged 1 commit into from
Nov 15, 2021
Merged

new natural primary key scheme #18

merged 1 commit into from
Nov 15, 2021

Conversation

i-norden
Copy link
Collaborator

@i-norden i-norden commented Nov 15, 2021

The composite primary keys are multi-column primary keys. This is the conventional way to do it but we could append the columns that compose a composite key together into a single value in a new column and use that single column as a primary key. This would make FK references "cleaner" since they only need to reference a single column, but would require more data duplication (e.g. in state_cids we have the header_id and state_path columns, and here we make a composite primary key out of those two columns, but we could create a new column called state_id that is header_id + state_path but then we need three columns header_id, state_path and state_id).

@i-norden
Copy link
Collaborator Author

Merging this and opening a new PR that includes a set of migrations with all PK and FK constraints removed (except PK constraint on public.blocks.key), that will be the set we run for batch processing whereas this set is the state we want to achieve after the batch process.

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

Successfully merging this pull request may close these issues.

1 participant