feat: sync latest ARR implementation

This commit is contained in:
Wyndham ARR
2026-07-31 15:11:42 +08:00
parent d6f8a747fa
commit bf7939dd1a
185 changed files with 17527 additions and 2260 deletions

View File

@@ -0,0 +1,30 @@
-- Roll back durable Booking Excel extraction drafts.
BEGIN;
DO $$
BEGIN
IF current_database() <> 'booking_test' THEN
RAISE EXCEPTION
'ARR Booking review rollback is allowed only in booking_test';
END IF;
IF to_regclass('booking.extraction_drafts') IS NULL
OR to_regclass('booking.extraction_draft_items') IS NULL THEN
RAISE EXCEPTION
'ARR Booking review migration is not applied';
END IF;
IF EXISTS (
SELECT 1
FROM booking.extraction_drafts
WHERE draft_status = 'reviewing'
) THEN
RAISE EXCEPTION
'ARR Booking review rollback refused while a review draft is open';
END IF;
END;
$$;
DROP TABLE booking.extraction_draft_items;
DROP TABLE booking.extraction_drafts;
COMMIT;