mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
Merge pull request #2306 from alphagov/drop-stats_template_usage_by_month
Drop stats_template_usage_by_month table as it is no longer needed.
This commit is contained in:
@@ -1834,48 +1834,6 @@ class AuthType(db.Model):
|
||||
name = db.Column(db.String, primary_key=True)
|
||||
|
||||
|
||||
class StatsTemplateUsageByMonth(db.Model):
|
||||
__tablename__ = "stats_template_usage_by_month"
|
||||
|
||||
template_id = db.Column(
|
||||
UUID(as_uuid=True),
|
||||
db.ForeignKey('templates.id'),
|
||||
unique=False,
|
||||
index=True,
|
||||
nullable=False,
|
||||
primary_key=True
|
||||
)
|
||||
month = db.Column(
|
||||
db.Integer,
|
||||
nullable=False,
|
||||
index=True,
|
||||
unique=False,
|
||||
primary_key=True,
|
||||
default=datetime.datetime.month
|
||||
)
|
||||
year = db.Column(
|
||||
db.Integer,
|
||||
nullable=False,
|
||||
index=True,
|
||||
unique=False,
|
||||
primary_key=True,
|
||||
default=datetime.datetime.year
|
||||
)
|
||||
count = db.Column(
|
||||
db.Integer,
|
||||
nullable=False,
|
||||
default=0
|
||||
)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
'template_id': str(self.template_id),
|
||||
'month': self.month,
|
||||
'year': self.year,
|
||||
'count': self.count
|
||||
}
|
||||
|
||||
|
||||
class DailySortedLetter(db.Model):
|
||||
__tablename__ = "daily_sorted_letter"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user