mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 08:21:13 -05:00
Create a table SERVICE_DATA_RETENTION to store the number of days the notification is to be kept for.
This commit is contained in:
@@ -1843,3 +1843,15 @@ class Complaint(db.Model):
|
||||
'complaint_date': self.complaint_date.strftime(DATETIME_FORMAT) if self.complaint_date else None,
|
||||
'created_at': self.created_at.strftime(DATETIME_FORMAT),
|
||||
}
|
||||
|
||||
|
||||
class ServiceDataRetention(db.Model):
|
||||
__tablename__ = 'service_data_retention'
|
||||
|
||||
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'), unique=False, index=True, nullable=False)
|
||||
service = db.relationship(Service, backref=db.backref('service_data_retention'))
|
||||
notification_type = db.Column(notification_types, nullable=False)
|
||||
days_of_retention = db.Column(db.Integer, nullable=False)
|
||||
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, default=datetime.datetime.utcnow)
|
||||
|
||||
Reference in New Issue
Block a user