mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-30 11:18:54 -04:00
Add created_at and updated_at columns to ft_processing_time
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
|
||||
from app import db
|
||||
@@ -23,7 +25,8 @@ def insert_update_processing_time(processing_time):
|
||||
index_elements=[table.c.bst_date],
|
||||
set_={
|
||||
'messages_total': stmt.excluded.messages_total,
|
||||
'messages_within_10_secs': stmt.excluded.messages_within_10_secs
|
||||
'messages_within_10_secs': stmt.excluded.messages_within_10_secs,
|
||||
'updated_at': datetime.utcnow()
|
||||
}
|
||||
)
|
||||
db.session.connection().execute(stmt)
|
||||
|
||||
@@ -2074,6 +2074,8 @@ class FactProcessingTime(db.Model):
|
||||
bst_date = db.Column(db.Date, index=True, primary_key=True, nullable=False)
|
||||
messages_total = db.Column(db.Integer(), nullable=False)
|
||||
messages_within_10_secs = 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, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
class Complaint(db.Model):
|
||||
|
||||
Reference in New Issue
Block a user