Skip to content
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

Try to drop the unique constraint on tables.table_name again #788

Closed
wants to merge 2 commits into from

Conversation

x4base
Copy link
Contributor

@x4base x4base commented Jul 20, 2016

There is an existing script b4456560d4f3_change_table_unique_constraint.py that tries to drop the unique constraint on tables.table_name. In that script, it assumes the constraint is named tables_table_name_key. But on my MySQL, it is not named that way. This PR tries to find the correct constraint name and tries to drop it again

@coveralls
Copy link

coveralls commented Jul 20, 2016

Coverage Status

Coverage decreased (-0.1%) to 81.061% when pulling 28f0060 on x4base:drop_tables_table_name_uniq into 83d5ad2 on airbnb:master.

@x4base
Copy link
Contributor Author

x4base commented Jul 28, 2016

This PR attempts to fix #360


def find_constraint_name():
return generic_find_unique_constraint_name(
table='tables', columns=['table_name'], db=db)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add the or default_constraint_name(...) inside find_constraint_name so we don't have too much wrappers

zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this pull request Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants