-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified db table and store token information in database
- Loading branch information
1 parent
4b44827
commit 749e0d3
Showing
5 changed files
with
71 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
-- Table: web.user_tokens | ||
-- Upgrade 8.0.x to 8.1.0 | ||
-- Be sure to backup the database and read the upgrade notes before executing. | ||
|
||
BEGIN; | ||
|
||
-- UPDATE web.settings SET value = '8.0.0' WHERE name = 'database_version'; | ||
|
||
-- DROP TABLE IF EXISTS web.user_tokens; | ||
|
||
CREATE TABLE IF NOT EXISTS web.user_tokens | ||
( | ||
id integer NOT NULL, | ||
user_id integer, | ||
user_id integer NOT NULL, | ||
name text COLLATE pg_catalog."default", | ||
jit text COLLATE pg_catalog."default", | ||
valid_from timestamp without time zone, | ||
valid_until timestamp without time zone, | ||
created timestamp without time zone, | ||
created timestamp without time zone NOT NULL DEFAULT now(), | ||
modified timestamp without time zone, | ||
CONSTRAINT user_tokens_pkey PRIMARY KEY (id), | ||
CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) | ||
REFERENCES web."user" (id) MATCH SIMPLE | ||
ON UPDATE NO ACTION | ||
ON DELETE NO ACTION | ||
NOT VALID | ||
) | ||
CONSTRAINT user_tokens_user_id_fkey FOREIGN KEY (user_id) REFERENCES web."user" (id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE SET NULL NOT VALID | ||
); | ||
|
||
|
||
ALTER TABLE IF EXISTS web.user_tokens OWNER to openatlas; | ||
CREATE SEQUENCE web.user_tokens_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; | ||
ALTER TABLE web.user_tokens_id_seq OWNER TO openatlas; | ||
ALTER SEQUENCE web.user_tokens_id_seq OWNED BY web.user_tokens.id; | ||
ALTER TABLE ONLY web.user_tokens ALTER COLUMN id SET DEFAULT nextval('web.user_tokens_id_seq'::regclass); | ||
|
||
TABLESPACE pg_default; | ||
|
||
ALTER TABLE IF EXISTS web.user_tokens | ||
OWNER to openatlas; | ||
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters