Replace incompatible MySQL 5.5 server_default
This commit is contained in:
parent
86584abba5
commit
59a6f5bc77
1 changed files with 3 additions and 1 deletions
|
@ -12,10 +12,12 @@ down_revision = '403d02fea323'
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
def upgrade(tables):
|
def upgrade(tables):
|
||||||
### commands auto generated by Alembic - please adjust! ###
|
### 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)
|
op.create_index('blobupload_created', 'blobupload', ['created'], unique=False)
|
||||||
### end Alembic commands ###
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
Reference in a new issue