From 65c8dc9573bbb4fb7cf47c4e1ad469f610028863 Mon Sep 17 00:00:00 2001 From: Antoine Lelong Date: Tue, 3 Dec 2024 16:10:04 +0100 Subject: [PATCH] fix: migrations for obiz_id error in offer_articles --- webapp/CHANGELOG.md | 3 +-- webapp/src/payload/migrations/20241202_083807.json | 6 ++++++ webapp/src/payload/migrations/20241203_093746.ts | 4 +--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/webapp/CHANGELOG.md b/webapp/CHANGELOG.md index 49a4da42..c95f2e44 100644 --- a/webapp/CHANGELOG.md +++ b/webapp/CHANGELOG.md @@ -1,9 +1,8 @@ ## [0.73.12](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.73.11...v0.73.12) (2024-12-03) - ### Bug Fixes -* layout header in obiz offer journey ([ddf4b98](https://github.com/SocialGouv/carte-jeune-engage/commit/ddf4b981de602d6d81b6f82b24492d73355533a1)) +- layout header in obiz offer journey ([ddf4b98](https://github.com/SocialGouv/carte-jeune-engage/commit/ddf4b981de602d6d81b6f82b24492d73355533a1)) ## [0.73.11](https://github.com/SocialGouv/carte-jeune-engage/compare/v0.73.10...v0.73.11) (2024-12-03) diff --git a/webapp/src/payload/migrations/20241202_083807.json b/webapp/src/payload/migrations/20241202_083807.json index 12cdb2e0..331fc8c7 100644 --- a/webapp/src/payload/migrations/20241202_083807.json +++ b/webapp/src/payload/migrations/20241202_083807.json @@ -1506,6 +1506,12 @@ "primaryKey": true, "notNull": true }, + "obiz_id": { + "name": "obiz_id", + "type": "varchar", + "primaryKey": false, + "notNull": false + }, "available": { "name": "available", "type": "boolean", diff --git a/webapp/src/payload/migrations/20241203_093746.ts b/webapp/src/payload/migrations/20241203_093746.ts index 5bf3730f..6ee2c85a 100644 --- a/webapp/src/payload/migrations/20241203_093746.ts +++ b/webapp/src/payload/migrations/20241203_093746.ts @@ -19,7 +19,6 @@ CREATE TABLE IF NOT EXISTS "couponsignals_rels" ( "coupons_id" integer ); -ALTER TABLE "offers_articles" ADD COLUMN "obiz_id" varchar; CREATE INDEX IF NOT EXISTS "couponsignals_created_at_idx" ON "couponsignals" ("created_at"); CREATE INDEX IF NOT EXISTS "couponsignals_rels_order_idx" ON "couponsignals_rels" ("order"); CREATE INDEX IF NOT EXISTS "couponsignals_rels_parent_idx" ON "couponsignals_rels" ("parent_id"); @@ -43,7 +42,6 @@ export async function down({ payload }: MigrateDownArgs): Promise { await payload.db.drizzle.execute(sql` DROP TABLE "couponsignals"; -DROP TABLE "couponsignals_rels"; -ALTER TABLE "offers_articles" DROP COLUMN IF EXISTS "obiz_id";`); +DROP TABLE "couponsignals_rels";`); };