Skip to content

Commit

Permalink
targetdb.targeting_generation_to_carton: edit constraint targeting_ge…
Browse files Browse the repository at this point in the history
…neration_to_carton_uniq_key (#279)
  • Loading branch information
astronomygupta authored Dec 4, 2024
1 parent debf289 commit ddf03b9
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ TRUNCATE targeting_generation_to_carton_temp;
\copy targeting_generation_to_carton_temp FROM 'targeting_generation_to_carton.csv' WITH CSV HEADER;

ALTER TABLE targetdb.targeting_generation_to_carton DROP CONSTRAINT IF EXISTS targeting_generation_to_carton_uniq_key;
ALTER TABLE targetdb.targeting_generation_to_carton ADD CONSTRAINT targeting_generation_to_carton_uniq_key UNIQUE (generation_pk,carton_pk);
ALTER TABLE targetdb.targeting_generation_to_carton ADD CONSTRAINT
targeting_generation_to_carton_uniq_key UNIQUE
(generation_pk,carton_pk,rs_stage,rs_active);

INSERT INTO targetdb.targeting_generation_to_carton (generation_pk, carton_pk, rs_stage, rs_active)
SELECT * FROM targeting_generation_to_carton_temp ON CONFLICT DO NOTHING;
Expand Down

0 comments on commit ddf03b9

Please sign in to comment.