aboutsummaryrefslogtreecommitdiff
path: root/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-10 10:34:00 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2020-03-10 10:34:00 +0100
commit677304ba3ecbd204fa2726e6820de84ad09bd868 (patch)
treebd19fbf2f1a0cddad1980fe15cf4c228867c5d69 /migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py
parentUpdated README. (diff)
downloadnewspipe-677304ba3ecbd204fa2726e6820de84ad09bd868.tar.gz
newspipe-677304ba3ecbd204fa2726e6820de84ad09bd868.tar.bz2
newspipe-677304ba3ecbd204fa2726e6820de84ad09bd868.zip
Added a tiny portion of black magic.
Diffstat (limited to 'migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py')
-rw-r--r--migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py38
1 files changed, 26 insertions, 12 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 035646c6..0da32e20 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
@@ -7,8 +7,8 @@ Create Date: 2015-03-10 14:20:53.676344
"""
# revision identifiers, used by Alembic.
-revision = '17dcb75f3fe'
-down_revision = 'cde34831ea'
+revision = "17dcb75f3fe"
+down_revision = "cde34831ea"
from datetime import datetime
import conf
@@ -18,17 +18,31 @@ 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)))
+ 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))
+ 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,
+ ),
+ )
bgstack15