LP 1198475: Add LOSTANDPAID as valid stop_fines. user/kmlussier/lp1198475_Lost_and_Paid_Status
authorJason Stephenson <jason@sigio.com>
Mon, 2 Jun 2014 23:57:15 +0000 (19:57 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 3 Jun 2014 17:00:22 +0000 (13:00 -0400)
Alter the check constraint on action.circulation.stop_fines,
circulation_stop_fines_check, to allow 'LOSTANDPAID' as a valid
value.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/sql/Pg/090.schema.action.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lost-and-paid-status.sql [new file with mode: 0644]

index ad78f50..5a7832c 100644 (file)
@@ -139,7 +139,7 @@ CREATE TABLE action.circulation (
        recurring_fine_rule     TEXT                            NOT NULL, -- name of "circ fine" rule
        max_fine_rule           TEXT                            NOT NULL, -- name of "max fine" rule
        stop_fines              TEXT                            CHECK (stop_fines IN (
-                                              'CHECKIN','CLAIMSRETURNED','LOST','MAXFINES','RENEW','LONGOVERDUE','CLAIMSNEVERCHECKEDOUT')),
+                                              'CHECKIN','CLAIMSRETURNED','LOST','MAXFINES','RENEW','LONGOVERDUE','CLAIMSNEVERCHECKEDOUT','LOSTANDPAID')),
        workstation         INT        REFERENCES actor.workstation(id)
                                       ON DELETE SET NULL
                                                                   DEFERRABLE INITIALLY DEFERRED,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lost-and-paid-status.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.lost-and-paid-status.sql
new file mode 100644 (file)
index 0000000..e22feac
--- /dev/null
@@ -0,0 +1,6 @@
+ALTER TABLE action.circulation
+      DROP CONSTRAINT circulation_stop_fines_check;
+
+ALTER TABLE action.circulation
+      ADD CONSTRAINT circulation_stop_fines_check
+      CHECK (stop_fines = ANY (ARRAY['CHECKIN'::text, 'CLAIMSRETURNED'::text, 'LOST'::text, 'MAXFINES'::text, 'RENEW'::text, 'LONGOVERDUE'::text, 'CLAIMSNEVERCHECKEDOUT'::text, 'LOSTANDPAID'::text]));