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

@@ -1774,7 +1774,7 @@ class FactBilling(db.Model):
rate = db.Column(db.Numeric(), nullable=True)
billable_units = db.Column(db.Integer(), nullable=True)
notifications_sent = db.Column(db.Integer(), nullable=True)
created_at = db.Column(db.DateTime, nullable=True, default=datetime.datetime.utcnow)
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)