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:
Adam Shimali
2016-04-25 16:12:46 +01:00
parent 4e4a5abbad
commit 24ea6f1637
4 changed files with 52 additions and 24 deletions

View File

@@ -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)