From f585878d0fa7538f571859114344aa1992836be9 Mon Sep 17 00:00:00 2001 From: jeancf Date: Sat, 15 Jul 2023 13:35:04 +0200 Subject: [PATCH] Add index on tweet_id to toots table in database --- twoot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/twoot.py b/twoot.py index cd6968d..036b385 100755 --- a/twoot.py +++ b/twoot.py @@ -924,8 +924,9 @@ def main(argv): mastodon_account TEXT, tweet_id TEXT, toot_id TEXT)''') db.execute('''CREATE INDEX IF NOT EXISTS main_index ON toots (twitter_account, mastodon_instance, mastodon_account, tweet_id)''') + db.execute('''CREATE INDEX IF NOT EXISTS tweet_id_index ON toots (tweet_id)''') db.execute('''CREATE TABLE IF NOT EXISTS profiles (mastodon_instance TEXT, mastodon_account TEXT, avatar_url TEXT, banner_url TEXT)''') - db.execute('''CREATE INDEX IF NOT EXIsTS profile_index ON profiles (mastodon_instance, mastodon_account)''') + db.execute('''CREATE INDEX IF NOT EXISTS profile_index ON profiles (mastodon_instance, mastodon_account)''') # Select random nitter instance to fetch updates from nitter_url = 'https://' + TOML['options']['nitter_instances'][random.randint(0, len(TOML['options']['nitter_instances']) - 1)]