Commit 5958fd68 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Ajout de la colonne CREATED_AT dans les scripts SQL de création de la table...

Ajout de la colonne CREATED_AT dans les scripts SQL de création de la table USER (non mappée dans l'entité).
parent 98b2fa25
......@@ -6,7 +6,8 @@ CREATE TABLE IF NOT EXISTS user
display_name VARCHAR(64) DEFAULT NULL,
password VARCHAR(128) NOT NULL,
state SMALLINT default 1,
last_role_id INTEGER default null
last_role_id INTEGER default null,
created_on DATE default current_date not null
);
ALTER TABLE user ADD PASSWORD_RESET_TOKEN varchar(256) DEFAULT NULL;
CREATE UNIQUE INDEX user_unique_username ON user(username);
......
......@@ -6,6 +6,7 @@ CREATE TABLE user (
password VARCHAR(128) NOT NULL,
state SMALLINT default 1,
last_role_id INT(11) default null,
created_on DATE default now() not null,
PRIMARY KEY (id),
UNIQUE INDEX unique_username (username ASC)
) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
......
......@@ -6,6 +6,7 @@ CREATE TABLE "USER"
"PASSWORD" VARCHAR2(128 CHAR) NOT NULL ENABLE,
"STATE" SMALLINT DEFAULT 1 NOT NULL ENABLE,
"last_role_id" NUMBER(*,0),
created_on DATE default sysdate not null,
CONSTRAINT "USER_PK" PRIMARY KEY ("ID"),
CONSTRAINT "USER_USERNAME_UN" UNIQUE ("USERNAME"),
CONSTRAINT "USER_LAST_ROLE_FK" FOREIGN KEY ("last_role_id") REFERENCES USER_ROLE ("ID") ENABLE
......@@ -64,6 +65,24 @@ INSERT INTO USER_ROLE_LINKER(user_id, role_id)
SELECT u.id, r.id FROM "USER" u, user_role r WHERE u.username = 'demo' and r.role_id = 'Standard';
CREATE TABLE USER_TOKEN
(
ID NUMBER(*, 0) NOT NULL,
USER_ID NUMBER(*,0) NOT NULL ENABLE,
TOKEN VARCHAR2(256) NOT NULL,
ACTION VARCHAR2(256) NOT NULL,
NB_ACTIONS smallint default 0 NOT NULL,
NB_ACTIONS_MAX smallint default 1 NOT NULL,
created_on DATE default sysdate not null,
expired_on DATE not null,
last_used_on DATE,
CONSTRAINT USER_TOKEN_PK PRIMARY KEY (ID),
CONSTRAINT USER_TOKEN_USER_FK UNIQUE (USER_ID)
);
CREATE INDEX USER_TOKEN_USER_IDX ON USER_TOKEN (USER_ID);
CREATE SEQUENCE USER_TOKEN_ID_SEQ;
/**
* Privilèges
......
......@@ -6,6 +6,7 @@ CREATE TABLE "user" (
password VARCHAR(128) NOT NULL,
state SMALLINT default 1,
last_role_id SMALLINT,
created_on DATE default current_timestamp not null,
FOREIGN KEY (last_role_id) REFERENCES user_role (id) ON DELETE SET NULL
) ;
CREATE UNIQUE INDEX user_username_unique ON "user" (username);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment