-
-
Save kaniak274/de6089f42e3e3f30c283bf74ee4024f4 to your computer and use it in GitHub Desktop.
Enum downgrade for the enum article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def downgrade(): | |
op.execute("ALTER TYPE status RENAME TO status_old") | |
op.execute("CREATE TYPE status AS ENUM('STARTED', 'ACCEPTED')") | |
op.execute(( | |
"ALTER TABLE transactions ALTER COLUMN status TYPE status USING " | |
"status::text::status" | |
)) | |
op.execute("DROP TYPE status_old") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment