Migration to add folder_permissions to invited_users table

Added a new JSONB column, folder_permissions, to the invited_users table
to store a list of folders that an invited user can see. This is
nullable for now, but will be changed to be non-nullable and
back-populated later.
This commit is contained in:
Katie Smith
2019-03-11 14:30:47 +00:00
parent ba49b84677
commit 3e70407981
2 changed files with 24 additions and 1 deletions

View File

@@ -8,7 +8,8 @@ from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.dialects.postgresql import (
UUID,
JSON
JSON,
JSONB,
)
from sqlalchemy import UniqueConstraint, CheckConstraint, Index
from notifications_utils.columns import Columns
@@ -1692,6 +1693,7 @@ class InvitedUser(db.Model):
nullable=False,
default=SMS_AUTH_TYPE
)
folder_permissions = db.Column(JSONB(none_as_null=True), nullable=True, default=[])
# would like to have used properties for this but haven't found a way to make them
# play nice with marshmallow yet