Skip to content

feat: support cyclic foreign keys (v7) - #14572

Merged
ephys merged 9 commits into
mainfrom
ephys/forward-port-14499
Jun 15, 2022
Merged

ephys merged 9 commits into
mainfrom
ephys/forward-port-14499

Conversation

@ephys

@ephys ephys commented May 30, 2022

Copy link
Copy Markdown
Member

This PR is a port of #14499 to v7.

On top of the existing v6 changes, this PR:

  • migrates integration/support.ts to typescript, as the new tests have been ported to TS.
  • fixes the typings for options that accept deferrable classes

@ephys ephys self-assigned this May 30, 2022
@ephys ephys added the type: feature DEPRECATED: replace with the "feature" issue type label May 30, 2022
@WikiRik

WikiRik commented May 31, 2022

Copy link
Copy Markdown
Member

Could you check out the DB2 tests? I believe I have not seen these error messages before

@ephys

ephys commented Jun 7, 2022

Copy link
Copy Markdown
Member Author

How weird, the following is not valid in DB2:

INSERT INTO "custom_schema"."a"

DB2 supports creating schema but not specifying in which schema the table resides?

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you've solved the DB2 issue we should be good to merge

@ephys

ephys commented Jun 8, 2022 •

Copy link
Copy Markdown
Member Author

Oh I thought it was not valid because of the schema, but it's not valid because you need to specify at least one column when inserting with db2. I'll open a separate issue about this bug.

@ephys

ephys commented Jun 10, 2022 •

Copy link
Copy Markdown
Member Author

I "fixed" the first part of the issue by setting a default attribute (instead of its default value). We'll need to add a test to resolve this problem in a separate PR.

This PR uncovered two more bugs in the DB2 implementation:

  • DB2's QueryInterface#createTable silently marks all attributes that are part of an index as 'unique' (even if the index is not unique).
  • DB2's QueryInterface#changeColumn produces invalid SQL if the attribute is marked as unique.

I'll open separate PRs to fix that.

@ephys

ephys commented Jun 10, 2022

Copy link
Copy Markdown
Member Author

PR opened: #14619

@ephys ephys mentioned this pull request Jun 12, 2022
3 tasks done
WikiRik
WikiRik previously approved these changes Jun 13, 2022

@WikiRik WikiRik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do need to check after the various PRs have been merged if everything is still fine with DB2 but this looks good

@ephys

ephys commented Jun 13, 2022

Copy link
Copy Markdown
Member Author

I think I'll merge this one after the 2 db2 ones, and we should then expect db2 to be green with this one

@WikiRik

WikiRik commented Jun 15, 2022

Copy link
Copy Markdown
Member

@ephys can you look into the merge conflicts? I believe this one is up next for merging

@ephys
ephys requested a review from WikiRik June 15, 2022 16:49
@ephys
ephys merged commit 1e110c5 into main Jun 15, 2022
@ephys
ephys deleted the ephys/forward-port-14499 branch June 15, 2022 17:00
@ephys

ephys commented Jun 15, 2022

Copy link
Copy Markdown
Member Author

I'll trigger a new v7 alpha

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.0.0-alpha.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

released on @v7 type: feature DEPRECATED: replace with the "feature" issue type

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants