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

refactoring Schema to expose functions for database updates #1256

Merged
merged 7 commits into from
Dec 19, 2022

Conversation

mohs8421
Copy link
Contributor

This PR aims to expose functionality already available within a Schema to make it easier to update databases after changes.

Changes

  • Schema now has get_column_def() to make the creation of TableAlterStatement easier in migrations

@tyt2y3
Copy link
Member

tyt2y3 commented Nov 28, 2022

Good to have this feature

@billy1624
Copy link
Member

Hey @mohs8421, thanks for contributing!! Seems this PR is still in progress and there are more internal functions to be extracted and made public? Let me know when it's ready :)

@mohs8421
Copy link
Contributor Author

Hey @mohs8421, thanks for contributing!! Seems this PR is still in progress and there are more internal functions to be extracted and made public? Let me know when it's ready :)

yes, I want to extract the part about foreign keys as well, it should be almost straight forward too, although the confusion about TableForeignKey and ForeignKeyCreateStatement is a little bit anoying, since the later is missing a From<> implementation, I have to implement the creation of that one to get to the first one. Currently working on some other code, so it unfortunately has to wait a little bit.

… into From<RelationDef> implementations to make its usage easier in different context, like updating a database.
@mohs8421 mohs8421 marked this pull request as ready for review November 30, 2022 08:44
Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

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

Hey @mohs8421, looks good! I've a small refactoring mohs8421#1

Copy link
Member

@billy1624 billy1624 left a comment

Choose a reason for hiding this comment

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

Opppps... sorry, I forgot to set the name of the target table
mohs8421#2

@billy1624 billy1624 merged commit 1f27837 into SeaQL:master Dec 19, 2022
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.

@billy1624 billy1624 added this to the 0.11.x milestone Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants