mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 00:41:35 -05:00
Use short dates when selection notifications for deletion.
This means we will retain notifications for a full week and not delete records that are 7 x 24 hours older than the time of the run of the deletion task. Also the task only needs to run once a day now, so I have changed the celery config for the deletion tasks.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import uuid
|
||||
import datetime
|
||||
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.dialects.postgresql import (
|
||||
UUID,
|
||||
JSON
|
||||
)
|
||||
|
||||
from sqlalchemy import UniqueConstraint
|
||||
|
||||
@@ -410,3 +413,12 @@ class TemplateStatistics(db.Model):
|
||||
unique=False,
|
||||
nullable=False,
|
||||
default=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
class Event(object):
|
||||
|
||||
__tablename__ = 'events'
|
||||
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
type = db.Column(db.String(255), nullable=False)
|
||||
details = db.Column(JSON, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user