mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Merge pull request #1884 from alphagov/add-timestamps-to-ft-tables
Add timestamp columns to ft_billing table
This commit is contained in:
@@ -1774,6 +1774,8 @@ 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)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
|
||||
class DateTimeDimension(db.Model):
|
||||
|
||||
23
migrations/versions/0193_add_ft_billing_timestamps.py
Normal file
23
migrations/versions/0193_add_ft_billing_timestamps.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0193_add_ft_billing_timestamps
|
||||
Revises: 0192_drop_provider_statistics
|
||||
Create Date: 2018-05-22 10:23:21.937262
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = '0193_add_ft_billing_timestamps'
|
||||
down_revision = '0192_drop_provider_statistics'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('ft_billing', sa.Column('updated_at', sa.DateTime(), nullable=True))
|
||||
op.add_column('ft_billing', sa.Column('created_at', sa.DateTime(), nullable=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('ft_billing', 'created_at')
|
||||
op.drop_column('ft_billing', 'updated_at')
|
||||
Reference in New Issue
Block a user