diff --git a/alembic/versions/0001_initial.py b/alembic/versions/0001_initial.py index 7a42e67..21aa018 100644 --- a/alembic/versions/0001_initial.py +++ b/alembic/versions/0001_initial.py @@ -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",