LP#1047475 Set action.hold_request.email_notify to default to false
authorMichael Peters <mrpeters@library.in.gov>
Thu, 13 Sep 2012 20:28:04 +0000 (16:28 -0400)
committerBen Shum <bshum@biblio.org>
Tue, 18 Dec 2012 05:17:10 +0000 (00:17 -0500)
LP#1047475 points out that email notify prefs are ignored in TPAC.
Even if a patron deselects email notify during hold request time, it
will always be set to true due to the column default.

This change defaults the column in the database to false (like most
other similar columns are) and resolves the bug.

Credit to Steve Callender for the idea.

Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.action.hold_request.email_notify_default_false.sql [new file with mode: 0644]

index 1af6e89..833d7bc 100644 (file)
@@ -393,7 +393,7 @@ CREATE TABLE action.hold_request (
        hold_type               TEXT                            NOT NULL, -- CHECK (hold_type IN ('M','T','V','C')),  -- XXX constraint too constraining...
        holdable_formats        TEXT,
        phone_notify            TEXT,
-       email_notify            BOOL                            NOT NULL DEFAULT TRUE,
+       email_notify            BOOL                            NOT NULL DEFAULT FALSE,
        sms_notify              TEXT,
        sms_carrier             INT REFERENCES config.sms_carrier (id),
        frozen                  BOOL                            NOT NULL DEFAULT FALSE,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.action.hold_request.email_notify_default_false.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.action.hold_request.email_notify_default_false.sql
new file mode 100644 (file)
index 0000000..f899cec
--- /dev/null
@@ -0,0 +1,7 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+ALTER TABLE action.hold_request ALTER COLUMN email_notify SET DEFAULT 'false';
+
+COMMIT;