ALTER TABLE `nletes`.`booking_detail_unloading`
ADD COLUMN `PAYMENT_STATUS` VARCHAR(45) NULL AFTER `CONTAINER_NUMBER`;
UPDATE nlebackend.booking_detail_unloading
SET payment_status = 'PAID'
WHERE booking_header_id IN (
SELECT id
FROM nlebackend.booking_header
WHERE booking_header.BOOKING_STATUS = 'SUCCESS'
);
UPDATE nlebackend.booking_detail_unloading
SET payment_status = 'UNPAID'
WHERE booking_header_id IN (
SELECT id
FROM nlebackend.booking_header
WHERE booking_header.BOOKING_STATUS IN ('WAITING' , 'CANCEL')
);
277
Add new column in table booking_detail_unloading