Drop index concurrently when aborting add_index

This commit is contained in:
fabianlindfors 2022-01-12 01:13:23 +01:00
parent 480bcf8af1
commit b617c8dcda

View File

@ -59,10 +59,9 @@ impl Action for AddIndex {
fn abort(&self, _ctx: &MigrationContext, db: &mut dyn Conn) -> anyhow::Result<()> {
db.run(&format!(
"
DROP INDEX {name} ON {table}
DROP INDEX CONCURRENTLY IF EXISTS {name}
",
name = self.name,
table = self.table,
))
.context("failed to drop index")?;
Ok(())