New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop_index not work on postgresql #459
Comments
Looked into this issue. The problem is that currently the drop indexes and drop constraints are tied together in the We are tying indexes in with unique constraints. Postgres treats these differently so we either need to somehow identify them or separate them out in the |
I have same issue: My Migration: class AddIndexesToRelationships(Migration):
def up(self):
"""
Run the migrations.
"""
with self.schema.table('branches') as table:
table.index('code')
def down(self):
"""
Revert the migrations.
"""
with self.schema.table('branches') as table:
table.drop_index(['code']) My database after run the migration:
The error i got:
|
Describe the bug
add an index to column success, but failed to drop the index when migrating rollback
To Reproduce
Steps to reproduce the behavior:
up
methoddown
methodExpected behavior
drop_index generate sql
ALTER TABLE table_name DROP CONSTRAINT table_name_column_index
.but in postgresql should be
DROP INDEX table_name_column_index
Screenshots or code snippets
Failure
.
Success
Desktop (please complete the following information):
What database are you using?
Additional context
In the end, I execute the SQL statement
DROP INDEX ....
complete requirementsThe text was updated successfully, but these errors were encountered: