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 unique constraint and indent logic error #961

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Conversation

kmharrington
Copy link
Member

Found while trying to close our some LAT time codes. Change the unique constraint to deal correctly with different servers.

closes #960

To update existing tables will need to run. (I'll take care of doing this on site)

CREATE TABLE time_codes_new (
        id INTEGER NOT NULL, 
        stream_id VARCHAR, 
        suprsync_type INTEGER, 
        timecode INTEGER, 
        agent VARCHAR, 
        PRIMARY KEY (id), 
        UNIQUE (stream_id, suprsync_type, timecode, agent)
);

INSERT INTO time_codes_new SELECT * from time_codes;
DROP TABLE time_codes;
ALTER TABLE time_codes_new RENAME to time_codes;

Copy link
Contributor

@guanyilun guanyilun left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@kmharrington kmharrington merged commit 8303686 into master Sep 24, 2024
5 checks passed
@kmharrington kmharrington deleted the time-code-set-fix branch September 24, 2024 18:33
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.

TimeCode table unique constraint is not enough
2 participants