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 Request: schemadiff & OnlineDDL: support valid foreign key table cycles #15430

Closed
shlomi-noach opened this issue Mar 10, 2024 · 1 comment · Fixed by #15448
Closed

Comments

@shlomi-noach
Copy link
Contributor

Feature Description

VTGate's query serving distinguishes between valid and invalid foreign key loop references. For example, this pseudo code FK reference is valid:

users.avatar_id -> avatars.id
avatars.creator_id -> users.id

whereas the following is invalid:

t1.id -> t2.i
t2.i -> t1.id

In both cases we have two tables referencing each other. But in the first scenario, the referenced columns do not make a loop, where in the second scenario they do.

Right now schemadiff rejects table cycles altogether, just based on tables referencing each other. We want to make schemadiff compliant with query-serving logic and support valid cycles.

The output of schemadiff's diff should be then applicable to Online DDL.

We will create two distinct PRs:

  • One, to support valid cycles in schemadiff.
  • Another, to handle Online DDL.

Use Case(s)

Support valid foreign key schemas.

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

Successfully merging a pull request may close this issue.

1 participant