this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Don't create index/foreign key that already exists, fixes #25

+14 -2
+6
tests/test_migrations.py
··· 4 4 from twitter_to_sqlite import cli, migrations 5 5 6 6 from .test_import import zip_contents_path 7 + from .test_save_tweets import db, tweets 7 8 8 9 9 10 def test_no_migrations_on_first_run(tmpdir, zip_contents_path): ··· 47 48 {"id": 2, "source": "000e4c4db71278018fb8c322f070d051e76885b1"}, 48 49 {"id": 3, "source": "d3c1d39c57fecfc09202f20ea5e2db30262029fd"}, 49 50 ] == list(db["tweets"].rows) 51 + 52 + 53 + def test_convert_source_column_against_real_database(db): 54 + assert "migrations" not in db.table_names() 55 + migrations.convert_source_column(db)
+8 -2
twitter_to_sqlite/migrations.py
··· 18 18 "select id, source from tweets where source like '<%'" 19 19 ).fetchall(): 20 20 db["tweets"].update(id, {"source": extract_and_save_source(db, source)}) 21 - db["tweets"].create_index(["source"]) 22 - db["tweets"].add_foreign_key("source") 21 + try: 22 + db["tweets"].create_index(["source"]) 23 + except Exception: 24 + pass 25 + try: 26 + db["tweets"].add_foreign_key("source") 27 + except Exception: 28 + pass