From b35e9773198ef2d8b37c4ca223f08147db47de0b Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Sat, 12 Dec 2015 21:14:28 +0100 Subject: moving the root of source code from / to /src/ --- ...b75f3fe_changed_the_type_of_the_column_last_.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py (limited to 'src/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py') diff --git a/src/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py b/src/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py new file mode 100644 index 00000000..035646c6 --- /dev/null +++ b/src/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py @@ -0,0 +1,34 @@ +"""changed the type of the column 'last_modified' to string. + +Revision ID: 17dcb75f3fe +Revises: cde34831ea +Create Date: 2015-03-10 14:20:53.676344 + +""" + +# revision identifiers, used by Alembic. +revision = '17dcb75f3fe' +down_revision = 'cde34831ea' + +from datetime import datetime +import conf +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + unix_start = datetime(1970, 1, 1) + if 'sqlite' not in conf.SQLALCHEMY_DATABASE_URI: + op.drop_column('feed', 'last_modified') + op.add_column('feed', sa.Column('last_modified', sa.String(), + nullable=True, default=unix_start, + server_default=str(unix_start))) + + +def downgrade(): + unix_start = datetime(1970, 1, 1) + if 'sqlite' not in conf.SQLALCHEMY_DATABASE_URI: + op.drop_column('feed', 'last_modified') + op.add_column('feed', sa.Column('last_modified', sa.DateTime(), + nullable=True, default=unix_start, + server_default=unix_start)) -- cgit