Skip to content

Commit

Permalink
Update migration 194: store steps as JSONB instead of hierarchy
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
lucassousaf committed Oct 4, 2023
1 parent 3d44d20 commit 8ec6d0f
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
--;;
Expand Down

0 comments on commit 8ec6d0f

Please # to comment.