From ca2ca5493e17348360fa66c64abad3ee0336728b Mon Sep 17 00:00:00 2001
From: Guillaume Heurtier <guillaume.heurtier@maarch.org>
Date: Thu, 13 Feb 2020 15:48:50 +0100
Subject: [PATCH] FEAT #13049 TIME 0:20 added required fields column in actions

---
 migration/20.03/2003.sql | 1 +
 sql/structure.sql        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/migration/20.03/2003.sql b/migration/20.03/2003.sql
index 03987e3172d..4a4f163f327 100644
--- a/migration/20.03/2003.sql
+++ b/migration/20.03/2003.sql
@@ -529,6 +529,7 @@ DO $$ BEGIN
     DELETE FROM actions_groupbaskets WHERE id_action in (SELECT id FROM actions WHERE enabled = 'N');
     DELETE FROM groupbasket_redirect WHERE action_id in (SELECT id FROM actions WHERE enabled = 'N');
     DELETE FROM actions WHERE enabled = 'N';
+    ALTER TABLE actions ADD COLUMN required_fields jsonb NOT NULL DEFAULT '[]';
   END IF;
 END$$;
 
diff --git a/sql/structure.sql b/sql/structure.sql
index 00f3b1e87c1..016cf7215fe 100755
--- a/sql/structure.sql
+++ b/sql/structure.sql
@@ -23,6 +23,7 @@ CREATE TABLE actions
   action_page character varying(255),
   component CHARACTER VARYING (128),
   history character(1) NOT NULL DEFAULT 'N'::bpchar,
+  required_fields jsonb NOT NULL DEFAULT '[]',
   CONSTRAINT actions_pkey PRIMARY KEY (id)
 )
 WITH (OIDS=FALSE);
-- 
GitLab