aboutsummaryrefslogtreecommitdiff
path: root/migrations
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-20 22:45:46 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-20 22:45:46 +0100
commit47769cbe3f70d507cf51168f5ffeee5ccbca7b71 (patch)
tree86eba200c8c927c75b756f29e920345eedbb6c08 /migrations
parentfixed old migration script (diff)
downloadnewspipe-47769cbe3f70d507cf51168f5ffeee5ccbca7b71.tar.gz
newspipe-47769cbe3f70d507cf51168f5ffeee5ccbca7b71.tar.bz2
newspipe-47769cbe3f70d507cf51168f5ffeee5ccbca7b71.zip
fixed old migration script
Diffstat (limited to 'migrations')
-rw-r--r--migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py18
-rw-r--r--migrations/versions/1b750a389c22_remove_email_notification_column.py4
-rw-r--r--migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py10
3 files changed, 1 insertions, 31 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 b81e4520..a6aeb8c9 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
@@ -15,8 +15,6 @@ from datetime import datetime
import sqlalchemy as sa
from alembic import op
-import conf
-
def upgrade():
unix_start = datetime(1970, 1, 1)
@@ -32,19 +30,3 @@ def upgrade():
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,
- ),
- )
diff --git a/migrations/versions/1b750a389c22_remove_email_notification_column.py b/migrations/versions/1b750a389c22_remove_email_notification_column.py
index a1466668..fd1d3a01 100644
--- a/migrations/versions/1b750a389c22_remove_email_notification_column.py
+++ b/migrations/versions/1b750a389c22_remove_email_notification_column.py
@@ -13,11 +13,9 @@ down_revision = "48f561c0ce6"
import sqlalchemy as sa
from alembic import op
-import conf
-
def upgrade():
- if "sqlite" not in conf.SQLALCHEMY_DATABASE_URI:
+ if "sqlite" not in "SQLALCHEMY_DATABASE_URI":
op.drop_column("feed", "email_notification")
diff --git a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py
index 361804f3..333f6727 100644
--- a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py
+++ b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py
@@ -13,8 +13,6 @@ down_revision = "19bdaa6208e"
import sqlalchemy as sa
from alembic import op
-import conf
-
def upgrade():
op.create_table(
@@ -28,11 +26,3 @@ def upgrade():
if "sqlite" not in conf.SQLALCHEMY_DATABASE_URI:
op.create_foreign_key(None, "feed", "icon", ["icon_url"], ["url"])
op.drop_column("feed", "icon")
-
-
-def downgrade():
- op.add_column("feed", sa.Column("icon", sa.VARCHAR(), nullable=True))
- if "sqlite" not in conf.SQLALCHEMY_DATABASE_URI:
- op.drop_constraint(None, "feed", type_="foreignkey")
- op.drop_column("feed", "icon_url")
- op.drop_table("icon")
bgstack15