Add OpenId required colums.

This commit is contained in:
Paulo Gustavo Veiga 2013-03-17 23:19:29 -03:00
parent 9b21c77485
commit 67398fe07e
7 changed files with 237 additions and 193 deletions

View File

@ -1,10 +1,10 @@
INSERT INTO COLLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURDATE()); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURDATE());
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email) INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email)
values(1,'Test','User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURDATE(),1); VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1);
INSERT INTO COLLABORATOR(id,email,creation_date) values (2,'admin@wisemapping.org',CURDATE()); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE());
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email) INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email)
values(2,'Admin','User', 'admin',1237,CURDATE(),1); VALUES (2, 'Admin', 'User', 'admin', 1237, CURDATE(), 1);
COMMIT; COMMIT;

View File

@ -1,19 +1,20 @@
CREATE TABLE COLLABORATOR ( CREATE TABLE COLLABORATOR (
id INTEGER NOT NULL IDENTITY, id INTEGER NOT NULL IDENTITY,
email varchar(255) NOT NULL, email VARCHAR(255) NOT NULL,
creation_date date); creation_date DATE);
CREATE TABLE USER ( CREATE TABLE USER (
id INTEGER NOT NULL IDENTITY, id INTEGER NOT NULL IDENTITY,
colaborator_id INTEGER NOT NULL, colaborator_id INTEGER NOT NULL,
auth_schema CHAR(1) NOT NULL, authentication_type CHAR(1) NOT NULL,
firstname varchar(255) NOT NULL, authenticator_uri VARCHAR(255) NULL,
lastname varchar(255) NOT NULL, firstname VARCHAR(255) NOT NULL,
password varchar(255) NOT NULL, lastname VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
activation_code BIGINT NOT NULL, activation_code BIGINT NOT NULL,
activation_date DATE, activation_date DATE,
allow_send_email CHAR(1) NOT NULL, allow_send_email CHAR(1) NOT NULL,
locale varchar(5), locale VARCHAR(5),
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
); );
@ -26,7 +27,7 @@ public BOOLEAN NOT NULL,
creation_date DATETIME, creation_date DATETIME,
edition_date DATETIME, edition_date DATETIME,
creator_id INTEGER NOT NULL, creator_id INTEGER NOT NULL,
tags varchar(1014) , tags VARCHAR(1014),
last_editor_id INTEGER NOT NULL last_editor_id INTEGER NOT NULL
--FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) --FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
); );
@ -42,7 +43,7 @@ FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id));
CREATE TABLE COLLABORATION_PROPERTIES CREATE TABLE COLLABORATION_PROPERTIES
(id INTEGER NOT NULL IDENTITY, (id INTEGER NOT NULL IDENTITY,
starred BOOLEAN NOT NULL, starred BOOLEAN NOT NULL,
mindmap_properties varchar(512) mindmap_properties VARCHAR(512)
); );
CREATE TABLE COLLABORATION CREATE TABLE COLLABORATION
@ -59,7 +60,7 @@ FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id)
CREATE TABLE TAG CREATE TABLE TAG
(id INTEGER NOT NULL IDENTITY, (id INTEGER NOT NULL IDENTITY,
name varchar(255) NOT NULL, name VARCHAR(255) NOT NULL,
user_id INTEGER NOT NULL, user_id INTEGER NOT NULL,
--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id) --FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
); );
@ -67,7 +68,7 @@ user_id INTEGER NOT NULL,
CREATE TABLE ACCESS_AUDITORY ( CREATE TABLE ACCESS_AUDITORY (
id INTEGER NOT NULL IDENTITY, id INTEGER NOT NULL IDENTITY,
user_id INTEGER NOT NULL, user_id INTEGER NOT NULL,
login_date date login_date DATE
); );
COMMIT; COMMIT;

View File

@ -1,3 +1,6 @@
CREATE DATABASE wisemapping CHARACTER SET='utf8' COLLATE='utf8_unicode_ci'; CREATE DATABASE wisemapping
CREATE USER 'wisemapping'@'localhost' IDENTIFIED BY 'password'; CHARACTER SET = 'utf8'
COLLATE = 'utf8_unicode_ci';
CREATE USER 'wisemapping'@'localhost'
IDENTIFIED BY 'password';
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';

View File

@ -1,51 +1,71 @@
CREATE TABLE COLLABORATOR ( CREATE TABLE COLLABORATOR (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
email varchar(255) CHARACTER SET utf8 NOT NULL UNIQUE, email VARCHAR(255)
creation_date date CHARACTER SET utf8 NOT NULL UNIQUE,
) CHARACTER SET utf8; creation_date DATE
)
CHARACTER SET utf8;
CREATE TABLE USER ( CREATE TABLE USER (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
colaborator_id INTEGER NOT NULL, colaborator_id INTEGER NOT NULL,
firstname varchar(255) CHARACTER SET utf8 NOT NULL, authentication_type CHAR(1)
lastname varchar(255) CHARACTER SET utf8 NOT NULL, CHARACTER SET utf8 NOT NULL,
password varchar(255) CHARACTER SET utf8 NOT NULL, authenticator_uri VARCHAR(255)
CHARACTER SET utf8,
firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL,
password VARCHAR(255) CHARACTER SET utf8 NOT NULL,
activation_code BIGINT(20) NOT NULL, activation_code BIGINT(20) NOT NULL,
activation_date date, activation_date DATE,
allow_send_email char(1) CHARACTER SET utf8 NOT NULL default 0, allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0,
locale varchar(5), locale VARCHAR(5),
FOREIGN KEY(colaborator_id) REFERENCES COLLABORATOR(id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
) CHARACTER SET utf8 ; ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CREATE TABLE MINDMAP ( CREATE TABLE MINDMAP (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
title varchar(255) CHARACTER SET utf8 NOT NULL, title VARCHAR(255)
description varchar(255) CHARACTER SET utf8 NOT NULL, CHARACTER SET utf8 NOT NULL,
xml mediumblob NOT NULL, description VARCHAR(255)
public BOOL not null default 0, CHARACTER SET utf8 NOT NULL,
creation_date datetime, xml MEDIUMBLOB NOT NULL,
edition_date datetime, public BOOL NOT NULL DEFAULT 0,
creator_id INTEGER not null, creation_date DATETIME,
tags varchar(1014) CHARACTER SET utf8 , edition_date DATETIME,
creator_id INTEGER NOT NULL,
tags VARCHAR(1014)
CHARACTER SET utf8,
last_editor_id INTEGER NOT NULL, last_editor_id INTEGER NOT NULL,
FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id)
) CHARACTER SET utf8 ; ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CREATE TABLE MINDMAP_HISTORY CREATE TABLE MINDMAP_HISTORY
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
xml mediumblob NOT NULL, xml MEDIUMBLOB NOT NULL,
mindmap_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL,
creation_date datetime, creation_date DATETIME,
editor_id INTEGER NOT NULL, editor_id INTEGER NOT NULL,
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
) CHARACTER SET utf8 ; ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CREATE TABLE COLLABORATION_PROPERTIES ( CREATE TABLE COLLABORATION_PROPERTIES (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
starred BOOL NOT NULL default 0, starred BOOL NOT NULL DEFAULT 0,
mindmap_properties varchar(512) CHARACTER SET utf8 mindmap_properties VARCHAR(512)
) CHARACTER SET utf8; CHARACTER SET utf8
)
CHARACTER SET utf8;
CREATE TABLE COLLABORATION ( CREATE TABLE COLLABORATION (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
@ -54,21 +74,31 @@ properties_id INTEGER NOT NULL,
mindmap_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL,
role_id INTEGER NOT NULL, role_id INTEGER NOT NULL,
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id),
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ON DELETE CASCADE ON UPDATE NO ACTION, FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id)
FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id) ON DELETE CASCADE ON UPDATE NO ACTION ON DELETE CASCADE
) CHARACTER SET utf8 ; ON UPDATE NO ACTION,
FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id)
ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CREATE TABLE TAG ( CREATE TABLE TAG (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
name varchar(255) CHARACTER SET utf8 NOT NULL, name VARCHAR(255)
CHARACTER SET utf8 NOT NULL,
user_id INTEGER NOT NULL, user_id INTEGER NOT NULL,
FOREIGN KEY(user_id) REFERENCES USER(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (user_id) REFERENCES USER (colaborator_id)
) CHARACTER SET utf8 ; ON DELETE CASCADE
ON UPDATE NO ACTION
)
CHARACTER SET utf8;
CREATE TABLE ACCESS_AUDITORY ( CREATE TABLE ACCESS_AUDITORY (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
login_date date, login_date DATE,
user_id INTEGER NOT NULL user_id INTEGER NOT NULL
) CHARACTER SET utf8 ; )
CHARACTER SET utf8;
COMMIT; COMMIT;

View File

@ -1,10 +1,10 @@
INSERT INTO COLLABORATOR(id,email,creation_date) values (1,'test@wisemapping.org',CURRENT_DATE()); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE());
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email) INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email)
values(1,'Test','User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3',1237,CURRENT_DATE(),1); VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1);
INSERT INTO COLLABORATOR(id,email,creation_date) values (2,'admin@wisemapping.org',CURRENT_DATE()); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE());
INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email) INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email)
values(2,'Admin','User', 'admin',1237,CURRENT_DATE(),1); VALUES (2, 'Admin', 'User', 'admin', 1237, CURRENT_DATE(), 1);
COMMIT; COMMIT;

View File

@ -1,10 +1,12 @@
CREATE TABLE COLLABORATION_PROPERTIES ( CREATE TABLE COLLABORATION_PROPERTIES (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
starred BOOL NOT NULL default 0, starred BOOL NOT NULL DEFAULT 0,
mindmap_properties varchar(512) CHARACTER SET utf8 mindmap_properties VARCHAR(512)
) CHARACTER SET utf8; CHARACTER SET utf8
)
CHARACTER SET utf8;
drop table `MINDMAP_NATIVE`; DROP TABLE `MINDMAP_NATIVE`;
ALTER TABLE `MINDMAP_COLABORATOR` RENAME TO `COLLABORATION`; ALTER TABLE `MINDMAP_COLABORATOR` RENAME TO `COLLABORATION`;
ALTER TABLE `COLABORATOR` RENAME TO `COLLABORATOR`; ALTER TABLE `COLABORATOR` RENAME TO `COLLABORATOR`;
@ -14,14 +16,16 @@ ALTER TABLE `MINDMAP` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL
, DROP INDEX `owner_id` , DROP INDEX `owner_id`
, ADD INDEX `owner_id` (`creator_id` ASC); , ADD INDEX `owner_id` (`creator_id` ASC);
ALTER TABLE `COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL AFTER `role_id` ; ALTER TABLE `COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL
AFTER `role_id`;
DROP TABLE USER_LOGIN; DROP TABLE USER_LOGIN;
CREATE TABLE ACCESS_AUDITORY ( CREATE TABLE ACCESS_AUDITORY (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
user_id INTEGER NOT NULL, user_id INTEGER NOT NULL,
login_date date login_date DATE
) CHARACTER SET utf8 ; )
CHARACTER SET utf8;
#ALTER TABLE ACCESS_AUDITORY #ALTER TABLE ACCESS_AUDITORY
# ADD CONSTRAINT `user_id` # ADD CONSTRAINT `user_id`
@ -31,18 +35,22 @@ login_date date
# ON UPDATE NO ACTION # ON UPDATE NO ACTION
#, ADD INDEX `user_id` () ; #, ADD INDEX `user_id` () ;
ALTER TABLE `MINDMAP_HISTORY` DROP COLUMN `creator_user` , ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL AFTER `creation_date`; ALTER TABLE `MINDMAP_HISTORY` DROP COLUMN `creator_user`, ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL
AFTER `creation_date`;
ALTER TABLE `USER` ADD COLUMN `locale` VARCHAR(5) NULL AFTER `allowSendEmail` ; ALTER TABLE `USER` ADD COLUMN `locale` VARCHAR(5) NULL
AFTER `allowSendEmail`;
ALTER TABLE `MINDMAP` DROP COLUMN `last_editor` , ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 2 AFTER `tags` ; ALTER TABLE `MINDMAP` DROP COLUMN `last_editor`, ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 2
AFTER `tags`;
ALTER TABLE `USER` DROP COLUMN `username`, CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL, CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0'; ALTER TABLE `USER` DROP COLUMN `username`, CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL, CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0';
INSERT INTO `MINDMAP` (`last_editor_id`) VALUES (1); INSERT INTO `MINDMAP` (`last_editor_id`) VALUES (1);
INSERT INTO `COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wis.com', '2007-10-09'); INSERT INTO `COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wis.com', '2007-10-09');
DELETE FROM `USER` where activation_date is null; DELETE FROM `USER`
WHERE activation_date IS null;
DROP TABLE FEEDBACK; DROP TABLE FEEDBACK;

View File

@ -1,33 +1,35 @@
CREATE TABLE COLLABORATOR ( CREATE TABLE COLLABORATOR (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
email varchar(255) NOT NULL UNIQUE, email VARCHAR(255) NOT NULL UNIQUE,
creation_date date creation_date DATE
); );
CREATE TABLE "user" ( CREATE TABLE "user" (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
authentication_type TEXT NOT NULL,
authenticator_uri VARCHAR(255) NOT NULL,
colaborator_id INTEGER NOT NULL, colaborator_id INTEGER NOT NULL,
firstname varchar(255) NOT NULL, firstname VARCHAR(255) NOT NULL,
lastname varchar(255) NOT NULL, lastname VARCHAR(255) NOT NULL,
password varchar(255) NOT NULL, password VARCHAR(255) NOT NULL,
activation_code BIGINT NOT NULL, activation_code BIGINT NOT NULL,
activation_date date, activation_date DATE,
allow_send_email text NOT NULL default 0, allow_send_email TEXT NOT NULL DEFAULT 0,
locale varchar(5), locale VARCHAR(5),
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ON DELETE CASCADE ON UPDATE NO ACTION
); );
CREATE TABLE MINDMAP ( CREATE TABLE MINDMAP (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
title varchar(255) NOT NULL, title VARCHAR(255) NOT NULL,
description varchar(255) NOT NULL, description VARCHAR(255) NOT NULL,
xml bytea NOT NULL, xml BYTEA NOT NULL,
public BOOL not null default FALSE, public BOOL NOT NULL DEFAULT FALSE,
creation_date timestamp, creation_date TIMESTAMP,
edition_date timestamp, edition_date TIMESTAMP,
creator_id INTEGER not null, creator_id INTEGER NOT NULL,
tags varchar(1014) , tags VARCHAR(1014),
last_editor_id INTEGER NOT NULL --, last_editor_id INTEGER NOT NULL --,
--FOREIGN KEY(creator_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION --FOREIGN KEY(creator_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
); );
@ -35,9 +37,9 @@ last_editor_id INTEGER NOT NULL --,
CREATE TABLE MINDMAP_HISTORY CREATE TABLE MINDMAP_HISTORY
(id SERIAL NOT NULL PRIMARY KEY, (id SERIAL NOT NULL PRIMARY KEY,
xml bytea NOT NULL, xml BYTEA NOT NULL,
mindmap_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL,
creation_date timestamp, creation_date TIMESTAMP,
editor_id INTEGER NOT NULL, editor_id INTEGER NOT NULL,
FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION
); );
@ -45,8 +47,8 @@ FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ON DELETE CASCADE ON UPDATE NO AC
CREATE TABLE COLLABORATION_PROPERTIES ( CREATE TABLE COLLABORATION_PROPERTIES (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
starred BOOL NOT NULL default FALSE, starred BOOL NOT NULL DEFAULT FALSE,
mindmap_properties varchar(512) mindmap_properties VARCHAR(512)
); );
CREATE TABLE COLLABORATION ( CREATE TABLE COLLABORATION (
@ -62,7 +64,7 @@ FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id) ON DELETE CAS
CREATE TABLE TAG ( CREATE TABLE TAG (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
name varchar(255) NOT NULL, name VARCHAR(255) NOT NULL,
user_id INTEGER NOT NULL --, user_id INTEGER NOT NULL --,
--FOREIGN KEY(user_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION --FOREIGN KEY(user_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
); );
@ -70,7 +72,7 @@ user_id INTEGER NOT NULL --,
CREATE TABLE ACCESS_AUDITORY ( CREATE TABLE ACCESS_AUDITORY (
id SERIAL NOT NULL PRIMARY KEY, id SERIAL NOT NULL PRIMARY KEY,
login_date date, login_date DATE,
user_id INTEGER NOT NULL user_id INTEGER NOT NULL
); );