Skip to content
Snippets Groups Projects
Commit 7b5a3f9e authored by Davor's avatar Davor
Browse files

adde user role to DB

parent acd25c2e
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment