feat: sync latest ARR implementation
This commit is contained in:
1 parent
d6f8a747fa
commit
bf7939dd1a
185 files changed
+17527
-2260
No files matched your search
@@ -0,0 +1,37 @@
|
||||
-- Manual rollback for migration 013.
|
||||
-- Refuses to discard user-facing filename provenance once new uploads exist.
|
||||
|
||||
BEGIN;
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF current_database() <> 'booking_test' THEN
|
||||
RAISE EXCEPTION
|
||||
'ARR daily upload filename rollback is allowed only in booking_test';
|
||||
END IF;
|
||||
IF NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'ingestion'
|
||||
AND table_name = 'processing_runs'
|
||||
AND column_name = 'uploaded_filename'
|
||||
) THEN
|
||||
RAISE EXCEPTION
|
||||
'ARR daily upload filename migration is not applied';
|
||||
END IF;
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM ingestion.processing_runs
|
||||
WHERE uploaded_filename IS NOT NULL
|
||||
) THEN
|
||||
RAISE EXCEPTION
|
||||
'refusing rollback: uploaded filename provenance exists';
|
||||
END IF;
|
||||
END;
|
||||
$$;
|
||||
|
||||
ALTER TABLE ingestion.processing_runs
|
||||
DROP CONSTRAINT processing_runs_uploaded_filename_check,
|
||||
DROP COLUMN uploaded_filename;
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user