Update created_at column of ft_billing to be non-nullable

`created_at` was added previously and made nullable temporarily. This
commit now populates the column, ensures that it will always have a
value, and makes `created_at` non-nullable.
This commit is contained in:
Katie Smith
2018-05-22 14:49:48 +01:00
parent b405b131f6
commit c6c118fea1
5 changed files with 35 additions and 7 deletions

View File

@@ -229,7 +229,8 @@ def update_fact_billing(data, process_day):
stmt = stmt.on_conflict_do_update(
constraint="ft_billing_pkey",
set_={"notifications_sent": stmt.excluded.notifications_sent,
"billable_units": stmt.excluded.billable_units
"billable_units": stmt.excluded.billable_units,
"updated_at": datetime.utcnow()
}
)
db.session.connection().execute(stmt)