mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-07 14:58:24 -04: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)
|
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||||
sms_sender = db.Column(db.String(11), nullable=False)
|
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))
|
service = db.relationship(Service, backref=db.backref("service_sms_senders", uselist=True))
|
||||||
is_default = db.Column(db.Boolean, nullable=False, default=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'),
|
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):
|
class NotificationStatusTypes(db.Model):
|
||||||
__tablename__ = 'notification_status_types'
|
__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):
|
class Notification(db.Model):
|
||||||
@@ -1507,3 +1507,24 @@ class NotificationEmailReplyTo(db.Model):
|
|||||||
nullable=False,
|
nullable=False,
|
||||||
primary_key=True
|
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