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

Fix migration when adding uuids #1716

Merged
merged 3 commits into from Mar 4, 2022
Merged

Conversation

rolisz
Copy link
Contributor

@rolisz rolisz commented Mar 3, 2022

This is a fix for #1595.

What happened was that if there was data in the DB, a single uuid4 value would be created, so the migration would fail because of the unique constraint.

The change is to first create the field, without a unique constraint and with null values, run a Python function to create uuid4s for each Example, and then change the field to have the unique constraints.

@Hironsan Hironsan merged commit cdbe735 into doccano:master Mar 4, 2022
@Hironsan
Copy link
Member

Hironsan commented Mar 4, 2022

Great! Thanks.

I fixed the code a bit according to the following:

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

2 participants