-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
update tables unique key #15833
update tables unique key #15833
Conversation
❗ Please consider rebasing your branch to avoid db migration conflicts. |
@FishermanZzhang, sadly this wont work as every database encodes uniqueness with |
In my opinion. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
13 similar comments
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
def upgrade(): | ||
try: | ||
op.create_unique_constraint('tables_unique', 'tables', ['table_name', 'schema', 'database_id']) | ||
except Exception: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should catch the specific sqlite error
❗ Please consider rebasing your branch to avoid db migration conflicts. |
2 similar comments
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give context on why we'd want to add this constraint?
Also, this model is going away soon, see SIP-68 (#14909). The new model separates tables (which will have a uniqueness constraint) from datasets (which can point to the same table).
Closing this, since #14909 will replace it. |
SUMMARY
update dataset(tables) unique key
i just test on mysql. and I know the sqlite no support.
i found this code
#9882
but, not worked. why?
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION