fix(firstleg): support platform scope port schedules
This commit is contained in:
@@ -3721,7 +3721,7 @@ CREATE TABLE fl_port_schedule (
|
||||
CONSTRAINT fk_port_schedule_booking FOREIGN KEY (ocean_booking_id) REFERENCES fl_ocean_booking (id),
|
||||
CONSTRAINT fk_port_schedule_container FOREIGN KEY (container_booking_id) REFERENCES fl_container_booking (id),
|
||||
CONSTRAINT chk_port_schedule_booking_cutoff CHECK (((booking_cutoff_at is null) or (etd_at is null) or (booking_cutoff_at <= etd_at))),
|
||||
CONSTRAINT chk_port_schedule_customer CHECK ((customer_id > 0)),
|
||||
CONSTRAINT chk_port_schedule_customer CHECK ((customer_id >= 0)),
|
||||
CONSTRAINT chk_port_schedule_customs_cutoff CHECK (((customs_cutoff_at is null) or (etd_at is null) or (customs_cutoff_at <= etd_at))),
|
||||
CONSTRAINT chk_port_schedule_eta CHECK (((etd_at is null) or (eta_at is null) or (eta_at >= etd_at))),
|
||||
CONSTRAINT chk_port_schedule_expiry CHECK ((expires_at > observed_at)),
|
||||
@@ -5975,7 +5975,7 @@ CREATE TRIGGER trg_ocean_requirement_before_insert BEFORE INSERT ON fl_ocean_boo
|
||||
CREATE TRIGGER trg_ocean_requirement_before_update BEFORE UPDATE ON fl_ocean_booking_container_requirement FOR EACH ROW BEGIN IF (SELECT status FROM fl_ocean_booking WHERE id=OLD.ocean_booking_id) <> 'DRAFT' THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='仅草稿可维护箱型需求'; END IF; END$$
|
||||
|
||||
CREATE TRIGGER trg_port_schedule_before_insert BEFORE INSERT ON fl_port_schedule FOR EACH ROW BEGIN
|
||||
IF (SELECT customer_id FROM fl_ocean_booking WHERE id=NEW.ocean_booking_id) <> NEW.customer_id THEN
|
||||
IF COALESCE((SELECT customer_id FROM fl_ocean_booking WHERE id=NEW.ocean_booking_id),0) <> NEW.customer_id THEN
|
||||
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='船期客户与订舱客户不一致';
|
||||
END IF;
|
||||
IF NEW.container_booking_id IS NOT NULL AND NOT EXISTS (
|
||||
|
||||
Reference in New Issue
Block a user