@voyant-travel/framework-migrations 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +17 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +27 -0
- package/dist/bundle.test.d.ts +2 -0
- package/dist/bundle.test.d.ts.map +1 -0
- package/dist/bundle.test.js +18 -0
- package/dist/collector.d.ts +84 -0
- package/dist/collector.d.ts.map +1 -0
- package/dist/collector.js +136 -0
- package/dist/collector.test.d.ts +2 -0
- package/dist/collector.test.d.ts.map +1 -0
- package/dist/collector.test.js +167 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/load-folder.d.ts +15 -0
- package/dist/load-folder.d.ts.map +1 -0
- package/dist/load-folder.js +25 -0
- package/migrations/0000_framework_baseline.sql +7435 -0
- package/migrations/0001_framework_baseline.sql +1 -0
- package/migrations/0002_framework_baseline.sql +2 -0
- package/migrations/0003_framework_baseline.sql +2 -0
- package/migrations/0004_framework_baseline.sql +12 -0
- package/migrations/meta/0000_snapshot.json +68124 -0
- package/migrations/meta/0001_snapshot.json +68131 -0
- package/migrations/meta/0002_snapshot.json +68145 -0
- package/migrations/meta/0003_snapshot.json +68159 -0
- package/migrations/meta/0004_snapshot.json +67933 -0
- package/migrations/meta/_journal.json +41 -0
- package/package.json +47 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE "bookings" ADD COLUMN "custom_fields" jsonb DEFAULT '{}'::jsonb NOT NULL;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- custom-fields unification (phase 4): retire the EAV value side table.
|
|
2
|
+
-- GUARDED: refuse to drop while rows remain, so a deployment that hasn't run the
|
|
3
|
+
-- backfill (starters/operator/scripts/backfill-custom-fields.ts --clear) fails
|
|
4
|
+
-- the migration instead of silently losing data. Empty (backfilled) → drops.
|
|
5
|
+
DO $$
|
|
6
|
+
BEGIN
|
|
7
|
+
IF EXISTS (SELECT 1 FROM "custom_field_values") THEN
|
|
8
|
+
RAISE EXCEPTION 'custom_field_values still has rows — run scripts/backfill-custom-fields.ts --clear (copies values to each entity''s custom_fields column and clears the table) before upgrading, or the data will be lost.';
|
|
9
|
+
END IF;
|
|
10
|
+
END $$;
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
DROP TABLE "custom_field_values" CASCADE;
|