File tree Expand file tree Collapse file tree
database_admin/migrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,6 +146,25 @@ CREATE INDEX IF NOT EXISTS system_inventory_tags_index ON system_inventory USING
146146CREATE INDEX IF NOT EXISTS system_inventory_stale_timestamp_index ON system_inventory (stale_timestamp);
147147CREATE INDEX IF NOT EXISTS system_inventory_workspaces_index ON system_inventory USING GIN (workspaces);
148148
149+ -- UPDATE FKEYS
150+ ALTER TABLE IF EXISTS system_repo
151+ DROP CONSTRAINT system_platform_id,
152+ ADD CONSTRAINT system_inventory_id
153+ FOREIGN KEY (rh_account_id, system_id)
154+ REFERENCES system_inventory (rh_account_id, id);
155+
156+ ALTER TABLE IF EXISTS system_advisories
157+ DROP CONSTRAINT system_platform_id,
158+ ADD CONSTRAINT system_inventory_id
159+ FOREIGN KEY (rh_account_id, system_id)
160+ REFERENCES system_inventory (rh_account_id, id);
161+
162+ ALTER TABLE IF EXISTS system_package2
163+ DROP CONSTRAINT system_package2_rh_account_id_system_id_fkey,
164+ ADD CONSTRAINT system_inventory_id
165+ FOREIGN KEY (rh_account_id, system_id)
166+ REFERENCES system_inventory (rh_account_id, id);
167+
149168
150169
151170-- system_patch
You can’t perform that action at this time.
0 commit comments