From 80147a61220e2ab28d4039def0600d8a6baf9107 Mon Sep 17 00:00:00 2001
From: gsh18 <gsh18@inf.ufpr.br>
Date: Fri, 17 Jan 2020 10:50:40 -0300
Subject: [PATCH] Issue #15: Add SubForm table

---
 workspace/create/00-core-tables.sql |  7 +++++++
 workspace/fixture/input_answer.csv  | 30 ++++++++++++++---------------
 workspace/fixture/sub_form.csv      |  1 +
 3 files changed, 23 insertions(+), 15 deletions(-)
 create mode 100644 workspace/fixture/sub_form.csv

diff --git a/workspace/create/00-core-tables.sql b/workspace/create/00-core-tables.sql
index 97abe98..f116bc8 100644
--- a/workspace/create/00-core-tables.sql
+++ b/workspace/create/00-core-tables.sql
@@ -37,6 +37,7 @@ CREATE TABLE input_answer (
     id SERIAL PRIMARY KEY,
     id_form_answer INTEGER,
     id_input INTEGER,
+    id_sub_form INTEGER,
     value TEXT,
     placement INTEGER
 );
@@ -75,3 +76,9 @@ CREATE TABLE form_user (
     enabled BOOLEAN,
     forms INTEGER
 );
+
+CREATE TABLE sub_form (
+    id SERIAL PRIMARY KEY,
+    id_input INTEGER,
+    id_content_form INTEGER
+);
diff --git a/workspace/fixture/input_answer.csv b/workspace/fixture/input_answer.csv
index 97b09ae..4fd9955 100644
--- a/workspace/fixture/input_answer.csv
+++ b/workspace/fixture/input_answer.csv
@@ -1,15 +1,15 @@
-id;id_form_answer;id_input;value;placement
-1; 1; 6;Answer to Question 1 Form 3; 0
-2; 1; 7;Answer to Question 2 Form 3; 0
-3; 2; 4;Answer to Question 2 Form 2; 0
-4; 2; 5;Answer to Question 1 Form 2; 0
-5; 3; 1;Answer to Question 1 Form 1; 0
-6; 3; 2;Answer to Question 2 Form 1; 0
-7; 3; 3;Answer to Question 3 Form 1; 0
-8; 4; 4;Answer to Question 2 Form 2; 0
-9; 4; 5;Answer to Question 1 Form 2; 0
-10; 5; 6;Answer to Question 1 Form 3; 0
-11; 5; 7;Answer to Question 2 Form 3; 0
-12; 6; 1;Answer to Question 1 Form 1; 0
-13; 6; 2;Answer to Question 2 Form 1; 0
-14; 6; 3;Answer to Question 3 Form 1; 0
+id;id_form_answer;id_input;id_sub_form;value;placement
+1; 1; 6;;Answer to Question 1 Form 3; 0
+2; 1; 7;;Answer to Question 2 Form 3; 0
+3; 2; 4;;Answer to Question 2 Form 2; 0
+4; 2; 5;;Answer to Question 1 Form 2; 0
+5; 3; 1;;Answer to Question 1 Form 1; 0
+6; 3; 2;;Answer to Question 2 Form 1; 0
+7; 3; 3;;Answer to Question 3 Form 1; 0
+8; 4; 4;;Answer to Question 2 Form 2; 0
+9; 4; 5;;Answer to Question 1 Form 2; 0
+10; 5; 6;;Answer to Question 1 Form 3; 0
+11; 5; 7;;Answer to Question 2 Form 3; 0
+12; 6; 1;;Answer to Question 1 Form 1; 0
+13; 6; 2;;Answer to Question 2 Form 1; 0
+14; 6; 3;;Answer to Question 3 Form 1; 0
diff --git a/workspace/fixture/sub_form.csv b/workspace/fixture/sub_form.csv
new file mode 100644
index 0000000..18cc684
--- /dev/null
+++ b/workspace/fixture/sub_form.csv
@@ -0,0 +1 @@
+id;id_input;id_content_form
\ No newline at end of file
-- 
GitLab