From 5ddee6967f8641eb710622650da0020f33c688ac Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Mon, 18 May 2015 22:57:47 +0200 Subject: sqlite can't drop column, ignoring drop statement --- ...7dcb75f3fe_changed_the_type_of_the_column_last_.py | 19 ++++++++++++------- .../versions/48f561c0ce6_add_column_entry_id.py | 4 +++- ...cde34831ea_adding_feed_and_user_attributes_for_.py | 13 +++++++------ 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'migrations') diff --git a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py index e7790b3f..035646c6 100644 --- a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py +++ b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py @@ -10,20 +10,25 @@ Create Date: 2015-03-10 14:20:53.676344 revision = '17dcb75f3fe' down_revision = 'cde34831ea' +from datetime import datetime +import conf from alembic import op import sqlalchemy as sa -from datetime import datetime def upgrade(): unix_start = datetime(1970, 1, 1) - 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))) + 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) - 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)) + 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)) diff --git a/migrations/versions/48f561c0ce6_add_column_entry_id.py b/migrations/versions/48f561c0ce6_add_column_entry_id.py index e5bc5735..f464849a 100644 --- a/migrations/versions/48f561c0ce6_add_column_entry_id.py +++ b/migrations/versions/48f561c0ce6_add_column_entry_id.py @@ -12,6 +12,7 @@ down_revision = None branch_labels = None depends_on = None +import conf from alembic import op import sqlalchemy as sa @@ -21,4 +22,5 @@ def upgrade(): def downgrade(): - op.drop_column('article', 'entry_id') + if 'sqlite' not in conf.SQLALCHEMY_DATABASE_URI: + op.drop_column('article', 'entry_id') diff --git a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py index 03e96564..116fdaa1 100644 --- a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py +++ b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py @@ -34,10 +34,11 @@ def upgrade(): def downgrade(): # commands auto generated by Alembic - please adjust! ### - op.drop_column('user', 'refresh_rate') - op.drop_column('feed', 'last_modified') - op.drop_column('feed', 'last_error') - op.drop_column('feed', 'error_count') - op.drop_column('feed', 'last_retrieved') - op.drop_column('feed', 'etag') + if 'sqlite' not in conf.SQLALCHEMY_DATABASE_URI: + op.drop_column('user', 'refresh_rate') + op.drop_column('feed', 'last_modified') + op.drop_column('feed', 'last_error') + op.drop_column('feed', 'error_count') + op.drop_column('feed', 'last_retrieved') + op.drop_column('feed', 'etag') # end Alembic commands ### -- cgit From 84e335ebe6ffdd0d543e2a52060b417ba89ff378 Mon Sep 17 00:00:00 2001 From: François Schmidts Date: Mon, 18 May 2015 23:05:14 +0200 Subject: adding filters field --- .../versions/422da2d0234_adding_filters_field.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 migrations/versions/422da2d0234_adding_filters_field.py (limited to 'migrations') diff --git a/migrations/versions/422da2d0234_adding_filters_field.py b/migrations/versions/422da2d0234_adding_filters_field.py new file mode 100644 index 00000000..bcbdf042 --- /dev/null +++ b/migrations/versions/422da2d0234_adding_filters_field.py @@ -0,0 +1,22 @@ +"""adding filters field + +Revision ID: 422da2d0234 +Revises: 17dcb75f3fe +Create Date: 2015-05-18 23:03:15.809549 + +""" + +# revision identifiers, used by Alembic. +revision = '422da2d0234' +down_revision = '17dcb75f3fe' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('feed', sa.Column('filters', sa.PickleType(), nullable=True)) + + +def downgrade(): + op.drop_column('feed', 'filters') -- cgit