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:
Adam Shimali
2016-04-06 14:30:13 +01:00
parent 044f2b7896
commit 3057641e40
4 changed files with 41 additions and 41 deletions

View 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 ###