fix: idempotent user_role type creation in migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
63e7195e1a
commit
4e41ba02c0
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ depends_on = None
|
|||
|
||||
|
||||
def upgrade():
|
||||
op.execute("CREATE TYPE user_role AS ENUM ('admin', 'user')")
|
||||
op.execute("DO $$ BEGIN CREATE TYPE user_role AS ENUM ('admin', 'user'); EXCEPTION WHEN duplicate_object THEN NULL; END $$")
|
||||
|
||||
op.create_table(
|
||||
"users",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue