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

Fixes to table inheritance #3354

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dbhoot
Copy link

@dbhoot dbhoot commented Apr 25, 2024

Previously

Fixes #3024

There are two main fixes in this PR

  • Any alterations to a parent table never propagated to the children. This is because the columns of the parent table(s) were only added on table create.

  • Not null overrides on child tables were not applied correctly. This is because there was a shared column reference between the parent and child tables. When any override for any child table existed, it was applied to the shared reference, which actually affected (incorrectly) other tables.

Now

  • Changes to a parent table are propagated to the child tables
  • Child tables have their own copy of the column definition. Overriding on a single table only affects the column definition on the table which it was declared. Parent / Sibling tables are no longer affected.

How does this work?

When a child table inherits from a parent, we now update the parent table to have references to the child table. When we apply an alter statement to the parent, we also recursively traverse the children and apply the same alteration to the children.

@dbhoot dbhoot changed the title Fix table inheritance Fixes to table inheritance Apr 25, 2024
@dbhoot
Copy link
Author

dbhoot commented Oct 17, 2024

hi @kyleconroy -- is there any hope of this change getting reviewed / merged? Are there concerns about it the implementation or anything? I know the core maintainers are busy so I'd like to do what I can to help.

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.

Inherited tables do not get updating after adding column to parent table
1 participant