]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0276.schema.actor_usr_password_reset.sql
LP#1643709: Stamping upgrade scripts
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0276.schema.actor_usr_password_reset.sql
1 BEGIN;
2
3 -- action_trigger values were inserted in 0237, but we forgot about the
4 -- core table. Oops.
5
6 INSERT INTO config.upgrade_log (version) VALUES ('0276'); -- dbs
7
8 CREATE TABLE actor.usr_password_reset (
9   id SERIAL PRIMARY KEY,
10   uuid TEXT NOT NULL, 
11   usr BIGINT NOT NULL REFERENCES actor.usr(id) DEFERRABLE INITIALLY DEFERRED, 
12   request_time TIMESTAMP NOT NULL DEFAULT NOW(), 
13   has_been_reset BOOL NOT NULL DEFAULT false
14 );
15 COMMENT ON TABLE actor.usr_password_reset IS $$
16 /*
17  * Copyright (C) 2010 Laurentian University
18  * Dan Scott <dscott@laurentian.ca>
19  *
20  * Self-serve password reset requests
21  *
22  * ****
23  *
24  * This program is free software; you can redistribute it and/or
25  * modify it under the terms of the GNU General Public License
26  * as published by the Free Software Foundation; either version 2
27  * of the License, or (at your option) any later version.
28  *
29  * This program is distributed in the hope that it will be useful,
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32  * GNU General Public License for more details.
33  */
34 $$;
35 CREATE UNIQUE INDEX actor_usr_password_reset_uuid_idx ON actor.usr_password_reset (uuid);
36 CREATE INDEX actor_usr_password_reset_usr_idx ON actor.usr_password_reset (usr);
37 CREATE INDEX actor_usr_password_reset_request_time_idx ON actor.usr_password_reset (request_time);
38 CREATE INDEX actor_usr_password_reset_has_been_reset_idx ON actor.usr_password_reset (has_been_reset);
39
40 COMMIT;