Make invited_users folder_permissions column non-nullable

Now that notifications-admin is always sending through
folder_permissions, the folder_permissions column of the invited_user
table can be made non-nullable. The migration also backfills the column
(to []) to account for existing null values.
This commit is contained in:
Katie Smith
2019-03-20 10:29:42 +00:00
parent 8eb3e6d4b1
commit 8f5b5d636e
2 changed files with 27 additions and 1 deletions

View File

@@ -1693,7 +1693,7 @@ class InvitedUser(db.Model):
nullable=False,
default=SMS_AUTH_TYPE
)
folder_permissions = db.Column(JSONB(none_as_null=True), nullable=True, default=[])
folder_permissions = db.Column(JSONB(none_as_null=True), nullable=False, default=[])
# would like to have used properties for this but haven't found a way to make them
# play nice with marshmallow yet