CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE PROPERTY(PKEY VARCHAR(100) NOT NULL PRIMARY KEY,VALUE VARCHAR(200))
CREATE MEMORY TABLE ROLE(ROLE VARCHAR(50) NOT NULL PRIMARY KEY)
CREATE MEMORY TABLE TODO(ID VARCHAR(32) NOT NULL PRIMARY KEY,CREATION_DATE TIMESTAMP NOT NULL,DESCRIPTION VARCHAR(255) NOT NULL,PRIORITY INTEGER NOT NULL,COMPLETED TINYINT NOT NULL,COMPLETION_DATE TIMESTAMP,TODO_LIST_ID VARCHAR(32) NOT NULL,DUE_DATE TIMESTAMP)
CREATE MEMORY TABLE TODO_LIST(ID VARCHAR(32) NOT NULL PRIMARY KEY,NAME VARCHAR(100) NOT NULL,RSS_ALLOWED TINYINT NOT NULL,LAST_UPDATE TIMESTAMP)
CREATE MEMORY TABLE USER(LOGIN VARCHAR(50) NOT NULL PRIMARY KEY,PASSWORD VARCHAR(50) NOT NULL,ENABLED TINYINT NOT NULL,FIRST_NAME VARCHAR(100),LAST_NAME VARCHAR(100),EMAIL VARCHAR(150),CREATION_DATE TIMESTAMP NOT NULL,LAST_ACCESS_DATE TIMESTAMP NOT NULL)
CREATE MEMORY TABLE USER_ROLE(LOGIN VARCHAR(50) NOT NULL,ROLE VARCHAR(50) NOT NULL,CONSTRAINT SYS_FK_51 FOREIGN KEY(LOGIN) REFERENCES USER(LOGIN),CONSTRAINT SYS_FK_52 FOREIGN KEY(ROLE) REFERENCES ROLE(ROLE))
CREATE MEMORY TABLE USER_TODO_LIST(LOGIN VARCHAR(50) NOT NULL,LISTID VARCHAR(32) NOT NULL,CONSTRAINT SYS_FK_58 FOREIGN KEY(LOGIN) REFERENCES USER(LOGIN),CONSTRAINT SYS_FK_59 FOREIGN KEY(LISTID) REFERENCES TODO_LIST(ID))
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 20
SET SCHEMA PUBLIC
INSERT INTO PROPERTY VALUES('smtp.from','Tudu Lists')
INSERT INTO PROPERTY VALUES('smtp.host','localhost')
INSERT INTO PROPERTY VALUES('smtp.password','')
INSERT INTO PROPERTY VALUES('smtp.port','25')
INSERT INTO PROPERTY VALUES('smtp.user','')
INSERT INTO ROLE VALUES('ROLE_ADMIN')
INSERT INTO ROLE VALUES('ROLE_USER')
INSERT INTO TODO VALUES('4028808109d691f60109d69515730003','2006-03-07 22:20:27.999000000','Welcome to Tudu Lists!',100,0,'2006-03-07 22:20:27.999000000','4028808109d691f60109d69515730002',NULL)
INSERT INTO TODO VALUES('ff80808109538ff901095390cd1a0003','2006-02-10 11:45:31.988000000','Welcome to Tudu Lists!',100,0,'2006-02-10 11:45:31.988000000','ff80808109538ff901095390cd1a0002',NULL)
INSERT INTO TODO VALUES('ff8080810953bb31010953bc12180002','2006-02-10 12:32:47.758000000','Welcome to Tudu Lists!',100,0,'2006-02-10 12:32:47.758000000','ff808081095372ec010953738b830002',NULL)
INSERT INTO TODO_LIST VALUES('4028808109d691f60109d69515730002','Welcome!',0,NULL)
INSERT INTO TODO_LIST VALUES('ff808081095372ec010953738b830002','Welcome!',0,NULL)
INSERT INTO TODO_LIST VALUES('ff80808109538ff901095390cd1a0002','Welcome!',0,NULL)
INSERT INTO TODO_LIST VALUES('ff8080810954c464010954c5b1710002','ezae',1,'2006-04-25 22:08:22.808000000')
INSERT INTO USER VALUES('admin','admin',1,'admin','admin','admin@admin.fr','2000-01-01 00:00:00.0','2006-04-25 22:15:31.234000000')
INSERT INTO USER VALUES('test','test',1,'test','test','test@test.fr','2006-02-10 11:45:31.988000000','2006-04-25 22:16:55.375000000')
INSERT INTO USER VALUES('testuser','Test',1,'Test','Test','','2006-03-07 22:20:27.999000000','2006-04-25 22:15:15.932000000')
INSERT INTO USER_ROLE VALUES('admin','ROLE_ADMIN')
INSERT INTO USER_ROLE VALUES('admin','ROLE_USER')
INSERT INTO USER_ROLE VALUES('test','ROLE_USER')
INSERT INTO USER_ROLE VALUES('testuser','ROLE_USER')
INSERT INTO USER_TODO_LIST VALUES('admin','ff808081095372ec010953738b830002')
INSERT INTO USER_TODO_LIST VALUES('test','ff80808109538ff901095390cd1a0002')
INSERT INTO USER_TODO_LIST VALUES('testuser','4028808109d691f60109d69515730002')
