From fe145525ab9b1c3e653bec28be2856a379851269 Mon Sep 17 00:00:00 2001 From: jeancf Date: Mon, 22 Aug 2022 14:00:28 +0200 Subject: [PATCH] Added index on sqlite database --- twoot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/twoot.py b/twoot.py index 7ee8280..ddc8a97 100755 --- a/twoot.py +++ b/twoot.py @@ -297,6 +297,8 @@ def main(argv): db = sql.cursor() db.execute('''CREATE TABLE IF NOT EXISTS toots (twitter_account TEXT, mastodon_instance TEXT, mastodon_account TEXT, tweet_id TEXT, toot_id TEXT)''') + db.execute('''CREATE UNIQUE INDEX IF NOT EXITS master ON toots (twitter_account, + mastodon_instance, mastodon_account, tweet_id)''') # Select random nitter instance to fetch updates from nitter_url = NITTER_URLS[random.randint(0, len(NITTER_URLS)-1)]