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

Delete all PostgreSQL types when calling fresh (#765) #864

Merged
merged 2 commits into from
Aug 25, 2022

Conversation

karpa4o4
Copy link
Contributor

@karpa4o4 karpa4o4 commented Jul 11, 2022

PR Info

Closes #765.

Adds

This PR adds the removal of all PostgreSQL types in the current schema when calling fresh on migrator.

Unfortunately, it was not possible to remove all types without for, because when calling names, incorrect SQL is compiled.

DROP TYPE “test””test1”

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.

Thanks!! @karpa4o4 LGTM!

@billy1624 billy1624 requested a review from tyt2y3 August 1, 2022 09:06
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.

Btw... it'd be better if we have a migration test where we have PostgreSQL types (e.g. Enum) defined on the db. Can you create a new migration file where it define a new Enum on PostgreSQL?

@billy1624
Copy link
Member

Hey @karpa4o4, I added a test for creating db enum on PostgreSQL

Feel free to cherrypick :D

@karpa4o4
Copy link
Contributor Author

karpa4o4 commented Aug 7, 2022

@billy1624, done

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.

Thanks! @karpa4o4 You can fix the fmt warnings if you have time. This PR is good to merge, we can fix that after merged as well :)

@karpa4o4 karpa4o4 force-pushed the issue/765 branch 2 times, most recently from 89c0e9e to ddf2983 Compare August 10, 2022 19:48
@karpa4o4
Copy link
Contributor Author

@billy1624, the fmt warnings fixed.

@billy1624
Copy link
Member

Thank you so much @karpa4o4

@billy1624 billy1624 changed the base branch from master to cont-pr-864 August 25, 2022 05:02
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 @karpa4o4, thanks again for contributing!! I'll merge this into a working branch and do a few refactoring before it get merged into master :)

@billy1624 billy1624 merged commit 5e9a849 into SeaQL:cont-pr-864 Aug 25, 2022
@karpa4o4 karpa4o4 deleted the issue/765 branch August 26, 2022 14:04
billy1624 added a commit that referenced this pull request Sep 25, 2022
* Delete all PostgreSQL types when calling fresh (#765) (#864)

* Delete all PostgreSQL types when calling fresh (#765)

* Test create db enum migration

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>

* Refactoring

Co-authored-by: Denis Gavrilyuk <karpa4o4@gmail.com>
billy1624 added a commit that referenced this pull request Sep 25, 2022
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.

Migrate fresh not deleting postgres type
2 participants