From 59a6f5bc776eb958ee0f9fda5614ad37e9dfbd76 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Thu, 11 Feb 2016 15:07:16 -0500 Subject: [PATCH] Replace incompatible MySQL 5.5 server_default --- .../88e0f440a2f_add_created_field_to_the_blobupload_.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/migrations/versions/88e0f440a2f_add_created_field_to_the_blobupload_.py b/data/migrations/versions/88e0f440a2f_add_created_field_to_the_blobupload_.py index ab9c63585..1d4241b89 100644 --- a/data/migrations/versions/88e0f440a2f_add_created_field_to_the_blobupload_.py +++ b/data/migrations/versions/88e0f440a2f_add_created_field_to_the_blobupload_.py @@ -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 ###