mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dew-fix' into 'dev'
Bandaid db error on migrations by comment. See merge request crafty-controller/crafty-commander!55
This commit is contained in:
commit
c0a7a49479
@ -576,7 +576,7 @@ class db_shortcuts:
|
||||
elif base_data[key] != user_data[key]:
|
||||
up_data[key] = user_data[key]
|
||||
up_data['last_update'] = helper.get_time_as_string()
|
||||
logger.debug("user: {} +role:{} -role:{} +server:{} -server{}".format(user_data, added_roles, removed_roles, added_servers, removed_servers))
|
||||
logger.debug("user: {} +role:{} -role:{} +server:{} -server{}".format(user_data, added_roles, removed_roles))
|
||||
with database.atomic():
|
||||
for role in added_roles:
|
||||
User_Roles.get_or_create(user_id=user_id, role_id=role)
|
||||
|
@ -2,7 +2,7 @@
|
||||
import peewee
|
||||
|
||||
def migrate(migrator, database, **kwargs):
|
||||
migrator.add_columns('user_servers', permissions=peewee.CharField(default="00000000")) # First argument can be model class OR table name
|
||||
migrator.drop_columns('user_servers', permissions=peewee.CharField(default="00000000")) # First argument can be model class OR table name
|
||||
migrator.add_columns('role_servers', permissions=peewee.CharField(default="00000000")) # First argument can be model class OR table name
|
||||
"""
|
||||
Write your migrations here.
|
||||
|
Loading…
Reference in New Issue
Block a user