Skip to content

fix baseline migration script#2515

Merged
p-hoffmann merged 1 commit into
webapi-3.0from
p-hoffmann/fixci
May 18, 2026
Merged

fix baseline migration script#2515
p-hoffmann merged 1 commit into
webapi-3.0from
p-hoffmann/fixci

Conversation

@p-hoffmann
Copy link
Copy Markdown
Member

@p-hoffmann p-hoffmann commented May 18, 2026

This pull request reorganizes where the foreign key (FK) constraints for the sec_{entity} tables are declared in the B3.0.0__webapi_baseline.sql migration script. The FK constraints, which enforce referential integrity and use ON DELETE CASCADE, have been moved to a later section of the script to ensure that all referenced tables and primary keys exist before the constraints are added. No logic has changed, but the order of operations has been adjusted.

@p-hoffmann p-hoffmann requested a review from Copilot May 18, 2026 15:14
@p-hoffmann p-hoffmann merged commit c979423 into webapi-3.0 May 18, 2026
8 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adjusts the ordering of sec_{entity} foreign key constraint creation in the PostgreSQL baseline migration so that referenced primary keys/constraints are in place before the FKs are added.

Changes:

  • Removed the sec_{entity} FK ALTER TABLE ... ADD CONSTRAINT block from the sec_{entity} table creation area.
  • Added a note pointing readers to the later FK section.
  • Reintroduced the sec_{entity} FK constraint block later in the script (after relevant PK/constraint definitions).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1733 to +1734
ALTER TABLE ${ohdsiSchema}.sec_cohort_characterization
ADD CONSTRAINT fk_scc_sec_role_id
Comment on lines +1134 to +1135
-- down (search for "fk_scc_sec_role_id") because they reference primary keys
-- on sec_role and other tables that are not added until later in this script.
@chrisknoll chrisknoll deleted the p-hoffmann/fixci branch May 19, 2026 00:09
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.

2 participants