Forgiving add index in migration (#16092)

This commit is contained in:
Paulus Schoutsen authored and Paulus Schoutsen committed 2018-08-21 11:43:08 +02:00
1 parent 1be388c587
commit bd776c84bc
2 files changed
+20 -1

No files matched your search

+10
View File
@@ -80,3 +80,13 @@ def test_forgiving_add_column():
migration._add_columns(engine, 'hello', [
'context_id CHARACTER(36)',
])
def test_forgiving_add_index():
"""Test that add index will continue if index exists."""
engine = create_engine(
'sqlite://',
poolclass=StaticPool
)
models.Base.metadata.create_all(engine)
migration._create_index(engine, "states", "ix_states_context_id")