-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
Migrate fresh not deleting postgres type #765
Comments
Hey @MaderNoob, sorry for the delay. As discussed on Discord, we could delete all PostgreSQL types in current schema when calling
It would be a two steps process:
|
I'll open this issue for anyone who have interested in contributing :) |
@billy1624 can you assign me with this issue? |
@karpa4o4 done! |
@ikrivosheev thanks |
Thanks for the interest! @karpa4o4 |
* Delete all PostgreSQL types when calling fresh (#765) * Test create db enum migration Co-authored-by: Billy Chan <[email protected]>
* 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 <[email protected]> * Refactoring Co-authored-by: Denis Gavrilyuk <[email protected]>
Description
If the migration creates postgres types, running
sea-orm-cli migrate fresh
will fail because it doesn't delete types, and it will say that the type already exists.Steps to Reproduce
sea-orm-cli migrate up
sea-orm-cli migrate fresh
Expected Behavior
The fresh migration should work
Actual Behavior
The fresh migration returns an error saying that the enum type already exists.
Reproduces How Often
always
Versions
│ └── sea-orm v0.8.0
│ ├── sea-orm-macros v0.8.0 (proc-macro)
│ ├── sea-query v0.24.6
│ │ ├── sea-query-derive v0.2.0 (proc-macro)
│ │ ├── sea-query-driver v0.1.1 (proc-macro)
│ ├── sea-strum v0.23.0
│ │ └── sea-strum_macros v0.23.0 (proc-macro)
│ ├── sea-orm-migration v0.8.2
│ │ ├── sea-orm v0.8.0 ()
│ │ ├── sea-orm-cli v0.8.1
│ │ │ ├── sea-schema v0.8.0
│ │ │ │ ├── sea-query v0.24.6 ()
│ │ │ │ └── sea-schema-derive v0.1.0 (proc-macro)
│ │ ├── sea-schema v0.8.0 ()
├── sea-orm v0.8.0 ()
├── sea-orm-rocket v0.5.0
│ └── sea-orm-rocket-codegen v0.5.0 (proc-macro)
uname -a
Linux arch 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linux
pacman -Q postgresql
postgresql 14.2-1
Additional Information
Types should be first deleted when running a fresh migration.
The text was updated successfully, but these errors were encountered: