From 7b5a3f9eb9c0b4c6221eecfb29d0ab76dcf7bb82 Mon Sep 17 00:00:00 2001 From: Davor Date: Mon, 6 Jun 2022 11:10:44 +0200 Subject: [PATCH] adde user role to DB --- .../versions/5f462d2d9d25_convert_role_column_to_table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migrations/versions/5f462d2d9d25_convert_role_column_to_table.py b/migrations/versions/5f462d2d9d25_convert_role_column_to_table.py index 53a8a1d..bfc7843 100644 --- a/migrations/versions/5f462d2d9d25_convert_role_column_to_table.py +++ b/migrations/versions/5f462d2d9d25_convert_role_column_to_table.py @@ -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")