mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-17 21:20:59 -04:00
Rename model
Reflects the new name of the feature. Note that the name of the underlying table hasn’t changed because it’s explicitly set to `service_whitelist`. Changing this will be a more involved process.
This commit is contained in:
@@ -655,17 +655,17 @@ class ServicePermission(db.Model):
|
||||
MOBILE_TYPE = 'mobile'
|
||||
EMAIL_TYPE = 'email'
|
||||
|
||||
WHITELIST_RECIPIENT_TYPE = [MOBILE_TYPE, EMAIL_TYPE]
|
||||
whitelist_recipient_types = db.Enum(*WHITELIST_RECIPIENT_TYPE, name='recipient_type')
|
||||
GUEST_LIST_RECIPIENT_TYPE = [MOBILE_TYPE, EMAIL_TYPE]
|
||||
guest_list_recipient_types = db.Enum(*GUEST_LIST_RECIPIENT_TYPE, name='recipient_type')
|
||||
|
||||
|
||||
class ServiceWhitelist(db.Model):
|
||||
class ServiceGuestList(db.Model):
|
||||
__tablename__ = 'service_whitelist'
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False)
|
||||
service = db.relationship('Service', backref='whitelist')
|
||||
recipient_type = db.Column(whitelist_recipient_types, nullable=False)
|
||||
recipient_type = db.Column(guest_list_recipient_types, nullable=False)
|
||||
recipient = db.Column(db.String(255), nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user