mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 17:01:35 -05:00
Create a new table to map a notification to a SMS sender.
There is also some minor db model updates here so that the python db model match the db
This commit is contained in:
@@ -324,7 +324,7 @@ class ServiceSmsSender(db.Model):
|
||||
|
||||
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'), index=True, nullable=False)
|
||||
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, nullable=False, unique=False)
|
||||
service = db.relationship(Service, backref=db.backref("service_sms_senders", uselist=True))
|
||||
is_default = db.Column(db.Boolean, nullable=False, default=True)
|
||||
inbound_number_id = db.Column(UUID(as_uuid=True), db.ForeignKey('inbound_numbers.id'),
|
||||
@@ -881,7 +881,7 @@ DVLA_RESPONSE_STATUS_SENT = 'Sent'
|
||||
class NotificationStatusTypes(db.Model):
|
||||
__tablename__ = 'notification_status_types'
|
||||
|
||||
name = db.Column(db.String(255), primary_key=True)
|
||||
name = db.Column(db.String(), primary_key=True)
|
||||
|
||||
|
||||
class Notification(db.Model):
|
||||
@@ -1507,3 +1507,24 @@ class NotificationEmailReplyTo(db.Model):
|
||||
nullable=False,
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
|
||||
class NotificationSmsSender(db.Model):
|
||||
__tablename__ = "notification_to_sms_sender"
|
||||
|
||||
notification_id = db.Column(
|
||||
UUID(as_uuid=True),
|
||||
db.ForeignKey('notifications.id'),
|
||||
unique=True,
|
||||
index=True,
|
||||
nullable=False,
|
||||
primary_key=True
|
||||
)
|
||||
service_sms_sender_id = db.Column(
|
||||
UUID(as_uuid=True),
|
||||
db.ForeignKey('service_sms_senders.id'),
|
||||
unique=False,
|
||||
index=True,
|
||||
nullable=False,
|
||||
primary_key=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user