Replace incompatible MySQL 5.5 server_default

This commit is contained in:
Jake Moshenko 2016-02-11 15:07:16 -05:00
parent 86584abba5
commit 59a6f5bc77

View file

@ -12,10 +12,12 @@ down_revision = '403d02fea323'
from alembic import op
import sqlalchemy as sa
from datetime import datetime
def upgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.add_column('blobupload', sa.Column('created', sa.DateTime(), nullable=False, server_default=sa.text('now()')))
now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
op.add_column('blobupload', sa.Column('created', sa.DateTime(), nullable=False, server_default=sa.text(now)))
op.create_index('blobupload_created', 'blobupload', ['created'], unique=False)
### end Alembic commands ###