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): don't recreate miner_sector_deals primary key if it is correct #300

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

iand
Copy link
Contributor

@iand iand commented Dec 3, 2020

This retrospectively changes migration 23 but keeps backwards compatibility. Changing the primary key on a hypertable can't be done while it contains data. Since the data in miner_sector_deals is incomplete and we need to backfill then we can truncate the table.

This change introduces a pattern we can use to only perform destructive data changes when needed. We wrap the migration in a check for the existence of the new constraint.

@iand iand self-assigned this Dec 3, 2020
@iand iand requested review from frrist and placer14 December 3, 2020 12:22
@iand iand merged commit b51c90f into master Dec 4, 2020
@iand iand deleted the fix/migration23 branch December 4, 2020 12:27
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.

3 participants