aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-05-18 22:57:47 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2015-07-02 15:34:16 +0200
commit5ddee6967f8641eb710622650da0020f33c688ac (patch)
tree891c1a968f3a699a10d6be7a484bfaf8897c924f /migrations
parentsome factorising (diff)
downloadnewspipe-5ddee6967f8641eb710622650da0020f33c688ac.tar.gz
newspipe-5ddee6967f8641eb710622650da0020f33c688ac.tar.bz2
newspipe-5ddee6967f8641eb710622650da0020f33c688ac.zip
sqlite can't drop column, ignoring drop statement
Diffstat (limited to 'migrations')
-rw-r--r--migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py19
-rw-r--r--migrations/versions/48f561c0ce6_add_column_entry_id.py4
-rw-r--r--migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py13
3 files changed, 22 insertions, 14 deletions
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 ###
bgstack15