@@ -1,4 +1,4 @@
1−use super::{Action, MigrationContext};
1+use super::{common, Action, MigrationContext};
2use crate::{
2use crate::{
3 db::{Conn, Transaction},
3 db::{Conn, Transaction},
4 schema::Schema,
4 schema::Schema,
@@ -92,6 +92,19 @@ impl Action for RemoveColumn {
92 ctx: &MigrationContext,
92 ctx: &MigrationContext,
93 db: &'a mut dyn Conn,
93 db: &'a mut dyn Conn,
94 ) -> anyhow::Result<Option<Transaction<'a>>> {
94 ) -> anyhow::Result<Option<Transaction<'a>>> {
95+ let indices = common::get_indices_for_column(db, &self.table, &self.column)
96+ .context("failed getting column indices")?;
98+ for index in indices {
101+ DROP INDEX CONCURRENTLY IF EXISTS {name}
105+ .context("failed to drop index")?;
95 // Remove column, function and trigger
108 // Remove column, function and trigger
96 let query = format!(
109 let query = format!(