[open-ils-commits] r18620 - trunk/Open-ILS/src/sql/Pg (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Nov 5 12:45:48 EDT 2010


Author: gmc
Date: 2010-11-05 12:45:45 -0400 (Fri, 05 Nov 2010)
New Revision: 18620

Modified:
   trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
   trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql
   trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
Log:
fix user password reset request time column def

Needs to be a timestamp with time zone; fixes a bug
where it was interpreted as a UTC time, throwing off
the calculation of the expiration of the password reset
request.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>


Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-11-05 16:16:20 UTC (rev 18619)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql	2010-11-05 16:45:45 UTC (rev 18620)
@@ -70,7 +70,7 @@
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0457'); -- senator
+INSERT INTO config.upgrade_log (version) VALUES ('0459'); -- gmc
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,

Modified: trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql	2010-11-05 16:16:20 UTC (rev 18619)
+++ trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql	2010-11-05 16:45:45 UTC (rev 18620)
@@ -526,7 +526,7 @@
   id SERIAL PRIMARY KEY,
   uuid TEXT NOT NULL, 
   usr BIGINT NOT NULL REFERENCES actor.usr(id) DEFERRABLE INITIALLY DEFERRED, 
-  request_time TIMESTAMP NOT NULL DEFAULT NOW(), 
+  request_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), 
   has_been_reset BOOL NOT NULL DEFAULT false
 );
 COMMENT ON TABLE actor.usr_password_reset IS $$

Modified: trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-11-05 16:16:20 UTC (rev 18619)
+++ trunk/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2010-11-05 16:45:45 UTC (rev 18620)
@@ -15545,7 +15545,7 @@
 --  id SERIAL PRIMARY KEY,
 --  uuid TEXT NOT NULL, 
 --  usr BIGINT NOT NULL REFERENCES actor.usr(id) DEFERRABLE INITIALLY DEFERRED, 
---  request_time TIMESTAMP NOT NULL DEFAULT NOW(), 
+--  request_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(), 
 --  has_been_reset BOOL NOT NULL DEFAULT false
 --);
 --COMMENT ON TABLE actor.usr_password_reset IS $$
@@ -15573,6 +15573,8 @@
 --CREATE INDEX actor_usr_password_reset_request_time_idx ON actor.usr_password_reset (request_time);
 --CREATE INDEX actor_usr_password_reset_has_been_reset_idx ON actor.usr_password_reset (has_been_reset);
 
+ALTER TABLE actor.usr_password_reset ALTER COLUMN request_time TYPE TIMESTAMP WITH TIME ZONE;
+
 -- Use the identifier search class tsconfig
 DROP TRIGGER IF EXISTS metabib_identifier_field_entry_fti_trigger ON metabib.identifier_field_entry;
 CREATE TRIGGER metabib_identifier_field_entry_fti_trigger



More information about the open-ils-commits mailing list