From 6309bcd71515a9c823141d19aecb381a4b67df27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Lombra=C3=B1a=20Gonz=C3=A1lez?= Date: Sat, 27 Feb 2021 10:23:10 +0100 Subject: [PATCH] fix: remove social columns. Closes issue #2017 --- ...31c3c2ff9fab_drop_social_network_logins.py | 26 +++++++++++++++++++ pybossa/model/user.py | 3 --- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 alembic/versions/31c3c2ff9fab_drop_social_network_logins.py diff --git a/alembic/versions/31c3c2ff9fab_drop_social_network_logins.py b/alembic/versions/31c3c2ff9fab_drop_social_network_logins.py new file mode 100644 index 0000000000..a6058523a3 --- /dev/null +++ b/alembic/versions/31c3c2ff9fab_drop_social_network_logins.py @@ -0,0 +1,26 @@ +"""drop social network logins + +Revision ID: 31c3c2ff9fab +Revises: a791f9de9ac3 +Create Date: 2021-02-27 10:17:17.122501 + +""" + +# revision identifiers, used by Alembic. +revision = '31c3c2ff9fab' +down_revision = 'a791f9de9ac3' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.drop_column('user', 'twitter_user_id') + op.drop_column('user', 'google_user_id') + op.drop_column('user', 'facebook_user_id') + + +def downgrade(): + op.add_column('user', sa.Column('twitter_user_id', sa.BigInteger, unique=True)) + op.add_column('user', sa.Column('google_user_id', sa.BigInteger, unique=True)) + op.add_column('user', sa.Column('facebook_user_id', sa.BigInteger, unique=True)) diff --git a/pybossa/model/user.py b/pybossa/model/user.py index 6383eac399..e50cf09ebe 100644 --- a/pybossa/model/user.py +++ b/pybossa/model/user.py @@ -55,9 +55,6 @@ class User(db.Model, DomainObject, UserMixin): restrict = Column(Boolean, default=False, nullable=False) category = Column(Integer) flags = Column(Integer) - twitter_user_id = Column(BigInteger, unique=True) - facebook_user_id = Column(BigInteger, unique=True) - google_user_id = Column(String, unique=True) ckan_api = Column(String, unique=True) newsletter_prompted = Column(Boolean, default=False) valid_email = Column(Boolean, default=False)