···3838 "media",
3939 "media_tweets",
4040 } == set(db.table_names())
4141+ # And check for indexes
4242+ following_indexes = {tuple(i.columns) for i in db["following"].indexes}
4343+ assert {
4444+ ("followed_id", "follower_id"),
4545+ ("followed_id",),
4646+ ("follower_id",),
4747+ } == following_indexes
414842494350def test_users(db):
+6
twitter_to_sqlite/utils.py
···257257 ("follower_id", "users", "id"),
258258 ),
259259 )
260260+ # Ensure following has indexes
261261+ following_indexes = {tuple(i.columns) for i in db["following"].indexes}
262262+ if ("followed_id",) not in following_indexes:
263263+ db["following"].create_index(["followed_id"])
264264+ if ("follower_id",) not in following_indexes:
265265+ db["following"].create_index(["follower_id"])
260266261267262268def save_tweets(db, tweets, favorited_by=None):