Test for migrations fix in #162

This commit is contained in:
Simon Willison 2023-08-19 13:17:47 -07:00
parent c4dbb62e68
commit 075d9af3b6

View file

@ -71,3 +71,10 @@ def test_migrate_from_original_schema(has_record):
if has_record:
expected_tables.add("logs")
assert set(db.table_names()).issuperset(expected_tables)
def test_migrations_with_legacy_alter_table():
# https://github.com/simonw/llm/issues/162
db = sqlite_utils.Database(memory=True)
db.execute("pragma legacy_alter_table=on")
migrate(db)