Skip to content
Browse files

Commit missing sql scripts

  • Loading branch information...
1 parent 1d88fdd commit ee8c93e0c2057a292419f964d1c6bc468640a21f @cmoulliard cmoulliard committed Jan 19, 2012
View
63 database/src/config/hsqldb/reportdb-h2-script.sql
@@ -0,0 +1,63 @@
+<!--
+ ~ Copyright 2011 FuseSource
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+SCRIPTS TO BE USED TO SETUP REPORT_INCIDENT with H2 database
+
+1) CREATE REPORT SCHEMA
+************************
+
+CREATE SCHEMA REPORT;
+
+2) CREATE TABLES FOR REPORT SCHEMAS
+***********************************
+
+CREATE TABLE REPORT.OPENJPA_SEQUENCE_TABLE (
+ ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ SEQUENCE_VALUE BIGINT NOT NULL
+);
+
+
+CREATE TABLE REPORT.T_INCIDENT (
+ INCIDENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ INCIDENT_REF VARCHAR(55),
+ INCIDENT_DATE TIMESTAMP,
+ GIVEN_NAME VARCHAR(35),
+ FAMILY_NAME VARCHAR(35),
+ SUMMARY VARCHAR(35),
+ DETAILS VARCHAR(255),
+ EMAIL VARCHAR(60),
+ PHONE VARCHAR(35),
+ CREATION_DATE TIMESTAMP,
+ CREATION_USER VARCHAR(255)
+);
+
+
+3) INSERT RECORDS
+*****************
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('001','2011-03-21','Charles','Moulliard','Incident Webinar-001','This is a report incident for webinar-001','cmoulliard@fusesource.com','+111 10 20 300');
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('002','2011-03-22','Charles','Moulliard','Incident Webinar-002','This is a report incident for webinar-002','cmoulliard@fusesource.com','+111 10 20 300');
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('003','2011-03-23','Charles','Moulliard','Incident Webinar-003','This is a report incident for webinar-003','cmoulliard@fusesource.com','+111 10 20 300');
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('004','2011-03-24','Charles','Moulliard','Incident Webinar-004','This is a report incident for webinar-004','cmoulliard@fusesource.com','+111 10 20 300');
+
+
+6) Useful scripts
+******************
+DELETE FROM REPORT.T_INCIDENT;
+
+SELECT * FROM REPORT.T_INCIDENT;
+
+DROP SCHEMA REPORT;
+
View
93 database/src/config/hsqldb/reportdb-hsqldb-script.sql
@@ -0,0 +1,93 @@
+<!--
+ ~ Copyright 2011 FuseSource
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+1) CREATE REPORT SCHEMA
+************************
+
+CREATE SCHEMA REPORT AUTHORIZATION DBA
+
+2) CREATE TABLES FOR REPORT SCHEMAS
+***********************************
+
+CREATE TABLE REPORT.OPENJPA_SEQUENCE_TABLE (
+ ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ SEQUENCE_VALUE BIGINT NOT NULL
+)
+
+
+CREATE TABLE REPORT.T_INCIDENT (
+ INCIDENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ INCIDENT_REF VARCHAR(55),
+ INCIDENT_DATE TIMESTAMP,
+ GIVEN_NAME VARCHAR(35),
+ FAMILY_NAME VARCHAR(35),
+ SUMMARY VARCHAR(35),
+ DETAILS VARCHAR(255),
+ EMAIL VARCHAR(60),
+ PHONE VARCHAR(35),
+ CREATION_DATE TIMESTAMP,
+ CREATION_USER VARCHAR(255)
+)
+
+
+3) INSERT RECORDS
+*****************
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('001','2011-03-21','Charles','Moulliard','Incident Webinar-001','This is a report incident for webinar-001','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('002','2011-03-22','Charles','Moulliard','Incident Webinar-002','This is a report incident for webinar-002','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('003','2011-03-23','Charles','Moulliard','Incident Webinar-003','This is a report incident for webinar-003','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO REPORT.T_INCIDENT (INCIDENT_REF, INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('004','2011-03-24','Charles','Moulliard','Incident Webinar-004','This is a report incident for webinar-004','cmoulliard@fusesource.com','+111 10 20 300')
+
+
+4) CREATE TABLES FOR PUBLIC SCHEMAS
+*************************************
+CREATE TABLE PUBLIC.OPENJPA_SEQUENCE_TABLE (
+ ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ SEQUENCE_VALUE BIGINT NOT NULL
+)
+
+
+CREATE TABLE PUBLIC.T_INCIDENT (
+ INCIDENT_ID BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
+ INCIDENT_REF VARCHAR(55),
+ INCIDENT_DATE TIMESTAMP,
+ GIVEN_NAME VARCHAR(35),
+ FAMILY_NAME VARCHAR(35),
+ SUMMARY VARCHAR(35),
+ DETAILS VARCHAR(255),
+ EMAIL VARCHAR(60),
+ PHONE VARCHAR(35),
+ CREATION_DATE TIMESTAMP,
+ CREATION_USER VARCHAR(255)
+)
+
+5) INSERT RECORDS
+*****************
+INSERT INTO PUBLIC.T_INCIDENT (INCIDENT_ID,INCIDENT_REF,INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('1','001','2011-03-21','Charles','Moulliard','Incident Webinar-001','This is a report incident for webinar-001','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO PUBLIC.T_INCIDENT (INCIDENT_ID,INCIDENT_REF,INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('2','002','2011-03-22','Charles','Moulliard','Incident Webinar-002','This is a report incident for webinar-002','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO PUBLIC.T_INCIDENT (INCIDENT_ID,INCIDENT_REF,INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('3','003','2011-03-23','Charles','Moulliard','Incident Webinar-003','This is a report incident for webinar-003','cmoulliard@fusesource.com','+111 10 20 300')
+INSERT INTO PUBLIC.T_INCIDENT (INCIDENT_ID,INCIDENT_REF,INCIDENT_DATE,GIVEN_NAME,FAMILY_NAME,SUMMARY,DETAILS,EMAIL,PHONE) VALUES ('4','004','2011-03-24','Charles','Moulliard','Incident Webinar-004','This is a report incident for webinar-004','cmoulliard@fusesource.com','+111 10 20 300')
+
+
+6) Usefuls scripts
+******************
+DELETE FROM REPORT.T_INCIDENT
+
+SELECT * FROM REPORT.T_INCIDENT
+
+DELETE FROM PUBLIC.T_INCIDENT
+
+SELECT * FROM PUBLIC.T_INCIDENT
+

0 comments on commit ee8c93e

Please sign in to comment.
Something went wrong with that request. Please try again.