Forgiving add index in migration (#16092)
This commit is contained in:
1 parent
1be388c587
commit
bd776c84bc
2 files changed
+20
-1
No files matched your search
@@ -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")
|
||||
Reference in new issue
Block a user