From a2ce4a0e70843e9fbe9e1bac2918f31d583b073e Mon Sep 17 00:00:00 2001
From: Guillaume Heurtier <guillaume.heurtier@maarch.org>
Date: Mon, 30 Dec 2019 11:34:56 +0100
Subject: [PATCH] FEAT #11405 TIME 0:30 created table for following resources

---
 migration/19.12/1912.sql | 11 +++++++++++
 sql/structure.sql        | 10 ++++++++++
 2 files changed, 21 insertions(+)

diff --git a/migration/19.12/1912.sql b/migration/19.12/1912.sql
index a1aab46bd89..70160614c07 100644
--- a/migration/19.12/1912.sql
+++ b/migration/19.12/1912.sql
@@ -661,6 +661,17 @@ DO $$ BEGIN
 END$$;
 UPDATE baskets set basket_clause = replace(basket_clause, 'nature_id' , 'custom_fields->>''1''');
 
+/* users followed resources */
+DROP TABLE IF EXISTS users_followed_resources;
+CREATE TABLE users_followed_resources
+(
+    id serial NOT NULL,
+    res_id int NOT NULL,
+    user_id int NOT NULL,
+    CONSTRAINT users_followed_resources_pkey PRIMARY KEY (id)
+)
+WITH (OIDS=FALSE);
+
 TRUNCATE TABLE indexing_models;
 INSERT INTO indexing_models (id, category, label, "default", owner, private) VALUES (1, 'incoming', 'Courrier arrivée', TRUE, 23, FALSE);
 INSERT INTO indexing_models (id, category, label, "default", owner, private) VALUES (2, 'outgoing', 'Courrier départ', FALSE, 23, FALSE);
diff --git a/sql/structure.sql b/sql/structure.sql
index 571ea509f82..6137cae0d11 100755
--- a/sql/structure.sql
+++ b/sql/structure.sql
@@ -1454,3 +1454,13 @@ CREATE TABLE contacts_custom_fields_list
     CONSTRAINT contacts_custom_fields_list_unique_key UNIQUE (label)
 )
 WITH (OIDS=FALSE);
+
+/* users followed resources */
+CREATE TABLE users_followed_resources
+(
+    id serial NOT NULL,
+    res_id int NOT NULL,
+    user_id int NOT NULL,
+    CONSTRAINT users_followed_resources_pkey PRIMARY KEY (id)
+)
+WITH (OIDS=FALSE);
-- 
GitLab