mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Create a table for service_sms_senders.
Migration from inbound_number to service_sms_senders. May need to pull out the migration into another PR.
This commit is contained in:
@@ -278,6 +278,21 @@ class InboundNumber(db.Model):
|
||||
}
|
||||
|
||||
|
||||
class ServiceSmsSender(db.Model):
|
||||
__tablename__ = "service_sms_senders"
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
sms_sender = db.Column(db.String(11), nullable=False)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), unique=True, index=True, nullable=False)
|
||||
service = db.relationship(Service, backref=db.backref("service_sms_senders", uselist=False))
|
||||
is_default = db.Column(db.Boolean, nullable=False, default=True)
|
||||
inbound_number_id = db.Column(UUID(as_uuid=True), db.ForeignKey('inbound_numbers.id'),
|
||||
unique=True, index=True, nullable=True)
|
||||
inbound_number = db.relationship(InboundNumber, backref=db.backref("inbound_number", uselist=False))
|
||||
created_at = db.Column(db.DateTime, default=datetime.datetime.utcnow, nullable=False)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
class ServicePermission(db.Model):
|
||||
__tablename__ = "service_permissions"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user