mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 18:31:13 -05:00
Change sort order for templates from name to date using full timestamp
so that it would be most recently used at top.
This commit is contained in:
32
migrations/versions/0045_template_stats_update_timestamp.py
Normal file
32
migrations/versions/0045_template_stats_update_timestamp.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0045_template_stats_update_time
|
||||
Revises: 0044_add_template_stats
|
||||
Create Date: 2016-04-05 14:32:45.165755
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0045_template_stats_update_time'
|
||||
down_revision = '0044_add_template_stats'
|
||||
|
||||
import datetime
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.sql import table, column
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('template_statistics', sa.Column('updated_at', sa.DateTime(), nullable=True))
|
||||
updated_at = table('template_statistics', column('updated_at'))
|
||||
op.execute(updated_at.update().values(updated_at=datetime.datetime.utcnow()))
|
||||
op.alter_column('template_statistics', 'updated_at', nullable=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('template_statistics', 'updated_at')
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user