ALTER TABLE product_interception_notice ADD weight_rejected FLOAT NULL;

ALTER TABLE product_interception_notice
ADD COLUMN qcp5_row_id INTEGER;

ALTER TABLE product_interception_notice
ADD CONSTRAINT fk_product_interception_notice_qcp5_products
FOREIGN KEY ("qcp5_row_id") REFERENCES qcp5_products("id");

ALTER TABLE productothers_interception_notice ADD weight_rejected FLOAT NULL;

ALTER TABLE productothers_interception_notice
ADD COLUMN qcp5_row_other_id INTEGER; 

ALTER TABLE productothers_interception_notice
ADD CONSTRAINT fk_productothers_interception_notice_qcp5_others
FOREIGN KEY ("qcp5_row_other_id") REFERENCES qcp5_others("id");

ALTER TABLE destructionnotice ADD weight_rejected FLOAT NULL;

CREATE TABLE "destructionothersnotice"( 
    "id"                        bigserial PRIMARY KEY,
    "packinglist_others_id"     INT NOT NULL,
    "consignment_no"            VARCHAR NOT NULL,
    "exportcompany_id"          INT NOT NULL,
    "weight_rejected"           FLOAT NULL,
    "reason"                    VARCHAR NOT NULL,
    "action"                    VARCHAR NOT NULL,
    "notes"                     VARCHAR NOT NULL,
    "user_id"                   INT NOT NULL,
    "created_at"                TIMESTAMPTZ NOT NULL DEFAULT(now())
);
ALTER TABLE "destructionothersnotice" ADD FOREIGN KEY ("packinglist_others_id") REFERENCES "packinglist_others" ("id");
ALTER TABLE "destructionothersnotice" ADD FOREIGN KEY ("exportcompany_id") REFERENCES "exportcompanies" ("id");
ALTER TABLE "destructionothersnotice" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id");



