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

Add ability to alter foreign keys #299

Merged
merged 4 commits into from
Apr 30, 2022

Conversation

karatakis
Copy link
Contributor

PR Info

Adds

Breaking Changes

  • Change method signature prepare_foreign_key_create_statement_internal of ForeignKeyBuilder to include inside_table_single_alter: bool

Changes

@ikrivosheev
Copy link
Member

@karatakis Thanks for the PR. I left some comments)

src/backend/foreign_key_builder.rs Outdated Show resolved Hide resolved
src/table/alter.rs Outdated Show resolved Hide resolved
src/table/alter.rs Outdated Show resolved Hide resolved
@karatakis
Copy link
Contributor Author

Thanks for the review @ikrivosheev. I will resolve them ASAP

@tyt2y3
Copy link
Member

tyt2y3 commented Apr 9, 2022

Thank you for the contribution. Just a question, isn't that we have ForeignKeyDropStatement already? So you want to drop multiple keys in one statement?
I think the API looks good. As mentioned by ikrivosheev, refactoring the code a bit would make it easier to maintain.
Thank you again!

@karatakis karatakis marked this pull request as draft April 13, 2022 07:05
@karatakis karatakis marked this pull request as ready for review April 13, 2022 07:45
@karatakis
Copy link
Contributor Author

karatakis commented Apr 13, 2022

@tyt2y3 ForeignKeyDropStatement works just fine, but allows only single foreign key constrain modification. Yeah, the new code enable us to modify multiple foreign key constrains. I am open to any comments that will allow the project to be easier to maintain.

Copy link
Member

@ikrivosheev ikrivosheev left a comment

Choose a reason for hiding this comment

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

@karatakis thank you, some small comments.

src/table/alter.rs Outdated Show resolved Hide resolved
src/table/alter.rs Outdated Show resolved Hide resolved
src/backend/sqlite/foreign_key.rs Show resolved Hide resolved
Copy link
Member

@tyt2y3 tyt2y3 left a comment

Choose a reason for hiding this comment

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

Would appreciate some tweaks

@ikrivosheev ikrivosheev requested a review from tyt2y3 April 18, 2022 09:10
@ikrivosheev
Copy link
Member

@karatakis thank you for contribution!

@tyt2y3 LGTM!

@tyt2y3 tyt2y3 merged commit 62b7eab into SeaQL:master Apr 30, 2022
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.

Ability to alter foreign keys
3 participants