From 57f2d3c5cd2fdba10d407054f06aa7514420142e Mon Sep 17 00:00:00 2001
From: Rogan Hamby <rogan.hamby@gmail.com>
Date: Fri, 30 Nov 2018 14:34:04 -0500
Subject: [PATCH] LP#1709698: no longer require descriptions in report
 templates

Signed-off-by: Rogan Hamby <rogan.hamby@gmail.com>
Signed-off-by: Jessica Woolford <jwoolford@biblio.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
---
 Open-ILS/src/sql/Pg/reporter-schema.sql                       | 2 +-
 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.reporter.template.sql | 2 ++
 Open-ILS/src/templates/staff/reporter/t_edit_template.tt2     | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/xxxx.schema.reporter.template.sql

diff --git a/Open-ILS/src/sql/Pg/reporter-schema.sql b/Open-ILS/src/sql/Pg/reporter-schema.sql
index 8d0897d817..52f2f398d9 100644
--- a/Open-ILS/src/sql/Pg/reporter-schema.sql
+++ b/Open-ILS/src/sql/Pg/reporter-schema.sql
@@ -66,7 +66,7 @@ CREATE TABLE reporter.template (
 	owner		INT				NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
 	create_time	TIMESTAMP WITH TIME ZONE	NOT NULL DEFAULT NOW(),
 	name		TEXT				NOT NULL,
-	description	TEXT				NOT NULL,
+	description	TEXT				NOT NULL DEFAULT '',
 	data		TEXT				NOT NULL,
 	folder		INT				NOT NULL REFERENCES reporter.template_folder (id) DEFERRABLE INITIALLY DEFERRED
 );
diff --git a/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.reporter.template.sql b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.reporter.template.sql
new file mode 100644
index 0000000000..819b562184
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/xxxx.schema.reporter.template.sql
@@ -0,0 +1,2 @@
+ALTER TABLE reporter.template ALTER COLUMN description SET DEFAULT '';
+
diff --git a/Open-ILS/src/templates/staff/reporter/t_edit_template.tt2 b/Open-ILS/src/templates/staff/reporter/t_edit_template.tt2
index fbb266d3a0..cab7bd06bb 100644
--- a/Open-ILS/src/templates/staff/reporter/t_edit_template.tt2
+++ b/Open-ILS/src/templates/staff/reporter/t_edit_template.tt2
@@ -21,7 +21,7 @@
     [% l('Template Description') %]
   </div>
   <div class="col-md-10">
-    <div><textarea class="form-control" ng-model="templateDescription" required/></div>
+    <div><textarea class="form-control" ng-model="templateDescription" /></div>
   </div>
 </div>
 
-- 
2.11.0