From 48fc3fc9541b62bef96ff599bd920f809f2b6036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20J=C4=99dyk?= Date: Tue, 1 Feb 2022 13:36:05 +0100 Subject: [PATCH] non unique twt accounts --- ayct_backend/__init__.py | 2 ++ ayct_backend/twitter/models.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ayct_backend/__init__.py b/ayct_backend/__init__.py index 0775ac3..0145152 100644 --- a/ayct_backend/__init__.py +++ b/ayct_backend/__init__.py @@ -20,7 +20,9 @@ def create_app(): twitter_db.init_app(app) campaign_db.init_app(app) + twitter_db.drop_all(app=app) twitter_db.create_all(app=app) + campaign_db.drop_all(app=app) campaign_db.create_all(app=app) app.register_blueprint(twitter, url_prefix='/twitter') diff --git a/ayct_backend/twitter/models.py b/ayct_backend/twitter/models.py index ef86f7f..e35e1d3 100644 --- a/ayct_backend/twitter/models.py +++ b/ayct_backend/twitter/models.py @@ -8,7 +8,7 @@ class TwitterAccount(twitter_db.Model): account_id = twitter_db.Column(twitter_db.Integer, primary_key=True) user_id = twitter_db.Column(twitter_db.String(64), nullable=False) - twitter_account_id = twitter_db.Column(twitter_db.String(32), unique=True, nullable=False) - username = twitter_db.Column(twitter_db.String(16), unique=True, nullable=False) + twitter_account_id = twitter_db.Column(twitter_db.String(32), nullable=False) + username = twitter_db.Column(twitter_db.String(16), nullable=False) access_token = twitter_db.Column(twitter_db.String(256), nullable=False) access_token_secret = twitter_db.Column(twitter_db.String(256), nullable=False)