adde user role to DB

This commit is contained in:
Davor 2022-06-06 11:10:44 +02:00
parent acd25c2e44
commit 7b5a3f9eb9

View file

@ -30,8 +30,10 @@ def upgrade():
# Insert default role "admin" as ID 1
op.execute(sa.insert(role_table).values(id=1,name="admin"))
op.execute(sa.insert(role_table).values(id=2,name="user"))
# Set role_id 1 to all current "admin" users
op.execute("UPDATE app_role SET role_id = 1 WHERE role = 'admin'")
op.execute("UPDATE app_role SET role_id = 2 WHERE role = 'user'")
# Drop old column
op.drop_column("app_role", "role")