[open-ils-commits] r14170 - in trunk/Open-ILS/src/sql/Pg: . upgrade (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 25 23:38:31 EDT 2009


Author: phasefx
Date: 2009-09-25 23:38:28 -0400 (Fri, 25 Sep 2009)
New Revision: 14170

Added:
   trunk/Open-ILS/src/sql/Pg/upgrade/0024.data.default_billing_type.sql
Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Adds a default 'non-system' billing type if there are no other such billing types already defined.

Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-09-26 02:39:02 UTC (rev 14169)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2009-09-26 03:38:28 UTC (rev 14170)
@@ -51,7 +51,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0022'); --miker
+INSERT INTO config.upgrade_log (version) VALUES ('0024'); -- phasefx
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2009-09-26 02:39:02 UTC (rev 14169)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql	2009-09-26 03:38:28 UTC (rev 14170)
@@ -873,6 +873,7 @@
 
 SELECT SETVAL('config.billing_type_id_seq'::TEXT, 100);
 
+INSERT INTO config.billing_type (name, owner) VALUES ( oils_i18n_gettext('Misc', 'Misc', 'cbt', 'name'), 1);
 
 --006.data.permissions.sql:
 INSERT INTO permission.perm_list VALUES 

Added: trunk/Open-ILS/src/sql/Pg/upgrade/0024.data.default_billing_type.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0024.data.default_billing_type.sql	                        (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0024.data.default_billing_type.sql	2009-09-26 03:38:28 UTC (rev 14170)
@@ -0,0 +1,8 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0024');
+
+-- This only gets inserted if there are no other id > 100 billing types
+INSERT INTO config.billing_type (name, owner) SELECT DISTINCT oils_i18n_gettext('Misc', 'Misc', 'cbt', 'name'), 1 FROM config.billing_type_id_seq WHERE last_value < 101;
+
+COMMIT;



More information about the open-ils-commits mailing list