Skip to content

Conversation

EvanSun220
Copy link
Collaborator

Related Ticket:

Updates:

  • Added the scripts to add contraints for the combined logical keys in the related workspace tables.
  • The script is not finalized, please check it thoroughly before run it.

@EvanSun220 EvanSun220 self-assigned this Sep 29, 2025
@EvanSun220 EvanSun220 linked an issue Sep 29, 2025 that may be closed by this pull request
Copy link
Contributor

@maxdiebold-erg maxdiebold-erg left a comment

Choose a reason for hiding this comment

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

Looks like you got all of them! I noticed the unit_fuel table already has the unique constraint defined, so it was correctly omitted here.

There are a few keys that specify MON_LOC_ID as part of the key, when that column doesn't exist in the table. Removing it from the definitions resolves the issues, and aligns the constraints with those specified in the issue.


ALTER TABLE camdecmpswks.monitor_qualification_pct
ADD CONSTRAINT uq_monitor_qualification_pct_key
UNIQUE (MON_LOC_ID, MON_QUAL_ID, QUAL_YEAR);
Copy link
Contributor

Choose a reason for hiding this comment

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

This table doesn't have a MON_LOC_ID column.

Suggested change
UNIQUE (MON_LOC_ID, MON_QUAL_ID, QUAL_YEAR);
UNIQUE (MON_QUAL_ID, QUAL_YEAR);


ALTER TABLE camdecmpswks.monitor_qualification_lme
ADD CONSTRAINT uq_monitor_qualification_lme_key
UNIQUE (MON_LOC_ID, MON_QUAL_ID, QUAL_YEAR);
Copy link
Contributor

Choose a reason for hiding this comment

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

This table doesn't have a MON_LOC_ID column.

Suggested change
UNIQUE (MON_LOC_ID, MON_QUAL_ID, QUAL_YEAR);
UNIQUE (MON_QUAL_ID, QUAL_YEAR);


ALTER TABLE camdecmpswks.monitor_qualification_lee
ADD CONSTRAINT uq_monitor_qualification_lee_key
UNIQUE MON_LOC_ID, (MON_QUAL_ID, QUAL_TEST_DATE);
Copy link
Contributor

Choose a reason for hiding this comment

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

This table doesn't have a MON_LOC_ID column.

Suggested change
UNIQUE MON_LOC_ID, (MON_QUAL_ID, QUAL_TEST_DATE);
UNIQUE (MON_QUAL_ID, QUAL_TEST_DATE);

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.

Logical Keys for Monitoring Plan Import

2 participants