From 8ec6d0fc3b7853219fd0dfb6390d1d3fe6ef27be Mon Sep 17 00:00:00 2001 From: Lucas Sousa Date: Wed, 4 Oct 2023 15:37:51 +0200 Subject: [PATCH] Update migration 194: store steps as JSONB instead of hierarchy [Re #1611] * After discussing options internally with Martin, it was decided to use JSONB to store the steps of the plastic strategy. It's going to be faster for the FE iterations. --- .../migrations/194-setup-plastic-strategy-model.up.sql | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/backend/resources/migrations/194-setup-plastic-strategy-model.up.sql b/backend/resources/migrations/194-setup-plastic-strategy-model.up.sql index 6f6248246..9c76cfd23 100644 --- a/backend/resources/migrations/194-setup-plastic-strategy-model.up.sql +++ b/backend/resources/migrations/194-setup-plastic-strategy-model.up.sql @@ -2,13 +2,9 @@ BEGIN; --;; CREATE TABLE plastic_strategy ( id SERIAL PRIMARY KEY, - country_id INTEGER NOT NULL REFERENCES country (id) -); ---;; -CREATE TABLE plastic_strategy_step ( - id SERIAL PRIMARY KEY, - display_section_id TEXT NOT NULL, - completed BOOLEAN DEFAULT FALSE, + country_id INTEGER NOT NULL REFERENCES country (id), + steps JSONB, + created_at TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW(), last_updated_at TIMESTAMP WITHOUT TIME ZONE ); --;;