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

Remove table inheritance #8046

Open
neilt opened this issue Feb 25, 2024 · 2 comments
Open

Remove table inheritance #8046

neilt opened this issue Feb 25, 2024 · 2 comments
Assignees
Labels
type:housekeeping Refactoring or other code reorganizational work

Comments

@neilt
Copy link
Contributor

neilt commented Feb 25, 2024

There are 4 tables that have children through inheritance.

  1. note
  2. file_base
  3. translation
  4. file_secondary_attachment

There does not seem clear reasons why inherited tables are used. Covert all to regular tables. Then convert the used serial columns to use IDENTITY.

The reason for this is for clarity and improved code quality. Table inheritance is is often misunderstood.

From the Postgres docs, "Unique constraints and primary keys are not inherited in the current implementation. This makes the combination of inheritance and unique constraints rather dysfunctional."

@neilt neilt added the type:housekeeping Refactoring or other code reorganizational work label Feb 25, 2024
@neilt neilt self-assigned this Feb 25, 2024
@ehuelsmann
Copy link
Member

For files, I would like to change the design: to have one central file storage table with link tables to attach the files to other entities. This allows deduplication of files linked to more than one entity.
It will also remove the need for file_secondary_attachment.

@neilt
Copy link
Contributor Author

neilt commented Mar 7, 2024

For files, I would like to change the design: to have one central file storage table with link tables to attach the files to other entities. This allows deduplication of files linked to more than one entity. It will also remove the need for file_secondary_attachment.

I have not looked at the details yet, but that is inline with my first impressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:housekeeping Refactoring or other code reorganizational work
Projects
None yet
Development

No branches or pull requests

2 participants