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: add index column constraint to vm_messages table #1127

Merged
merged 1 commit into from
Feb 15, 2023

Conversation

frrist
Copy link
Member

@frrist frrist commented Feb 3, 2023

Copy link

@davidgasquez davidgasquez left a comment

Choose a reason for hiding this comment

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

LGTM!

This will make the current vm_messages table to have a missing index column. We could backfill it with 1 while we run an export again now that we won't have duplicates.

`
ALTER TABLE {{ .SchemaName | default "public"}}.vm_messages
ADD COLUMN "index" BIGINT NOT NULL,
ADD CONSTRAINT vm_messages_uniq_index UNIQUE (height, state_root, cid, source, index);

Choose a reason for hiding this comment

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

We can enforce/check this in the final dataset. :)

@frrist frrist merged commit 11ee6dc into master Feb 15, 2023
@frrist frrist deleted the frrist/vm_message_index branch February 15, 2023 20:42
@davidgasquez davidgasquez removed their assignment Feb 27, 2023
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.

Duplicated rows in vm_messages task when using CSV as storage
4 participants