blob: 6d2d1f0655acf63bf575bcc1aed96bc508f75a4c [file] [log] [blame]
ITSERVICES\rb7147e0addf52017-04-25 11:46:00 -04001-- ---------------------------------------------------------------------------------------------------------------
2-- This script creates tables in the 1707 COMMON version of the ECOMP SDK application database.
3-- Additional DDL scripts may be required for the AT&T version or the OPEN-SOURCE version!
4--
5-- Note to database admin: set the MySQL system variable called lower_case_table_names to 1
6-- It can be set 3 different ways:
7-- command-line options (Cmd-line),
8-- options valid in configuration files (Option file), or
9-- server system variables (System Var).
10--
11-- When set to 1 table names are stored in lowercase on disk and comparisons are not case sensitive.
12--
13-- MySql/MariaDB Version compatibility information
14--
15-- bash-4.2$ mysql --version – cluster version
16-- mysql Ver 15.1 Distrib 10.1.17-MariaDB, for Linux (x86_64) using readline 5.1
17--
18-- All versions newer or older than these DO NOT necessarily mean they are compatible.
19-- ---------------------------------------------------------------------------------------------------------------
20
21SET FOREIGN_KEY_CHECKS=1;
22
23CREATE DATABASE IF NOT EXISTS ecomp_sdk;
24
25USE ecomp_sdk;
26
27-- ---------- create table SECTION
28--
29-- NAME: CR_FAVORITE_REPORTS; TYPE: TABLE
30--
31create table cr_favorite_reports (
32 USER_ID INTEGER NOT NULL,
33 REP_ID INTEGER NOT NULL
34);
35
36--
37-- NAME: CR_FILEHIST_LOG; TYPE: TABLE
38--
39create table cr_filehist_log (
40 SCHEDULE_ID NUMERIC(11,0) NOT NULL,
41 URL CHARACTER VARYING(4000),
42 NOTES CHARACTER VARYING(3500),
43 RUN_TIME TIMESTAMP
44);
45
46--
47-- NAME: CR_FOLDER; TYPE: TABLE
48--
49create table cr_folder (
50 FOLDER_ID INTEGER NOT NULL,
51 FOLDER_NAME CHARACTER VARYING(50) NOT NULL,
52 DESCR CHARACTER VARYING(500),
53 CREATE_ID INTEGER NOT NULL,
54 CREATE_DATE TIMESTAMP NOT NULL,
55 PARENT_FOLDER_ID INTEGER,
56 PUBLIC_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL
57);
58
59--
60-- NAME: CR_FOLDER_ACCESS; TYPE: TABLE
61--
62create table cr_folder_access (
63 FOLDER_ACCESS_ID NUMERIC(11,0) NOT NULL,
64 FOLDER_ID NUMERIC(11,0) NOT NULL,
65 ORDER_NO NUMERIC(11,0) NOT NULL,
66 ROLE_ID NUMERIC(11,0),
67 USER_ID NUMERIC(11,0),
68 READ_ONLY_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL
69);
70
71--
72-- NAME: CR_HIST_USER_MAP; TYPE: TABLE
73--
74create table cr_hist_user_map (
75 HIST_ID INT(11) NOT NULL,
76 USER_ID INT(11) NOT NULL
77);
78
79--
80-- NAME: CR_LU_FILE_TYPE; TYPE: TABLE
81--
82create table cr_lu_file_type (
83 LOOKUP_ID NUMERIC(2,0) NOT NULL,
84 LOOKUP_DESCR CHARACTER VARYING(255) NOT NULL,
85 ACTIVE_YN CHARACTER(1) DEFAULT 'Y',
86 ERROR_CODE NUMERIC(11,0)
87);
88
89--
90-- NAME: CR_RAPTOR_ACTION_IMG; TYPE: TABLE
91--
92create table cr_raptor_action_img (
93 IMAGE_ID CHARACTER VARYING(100) NOT NULL,
94 IMAGE_LOC CHARACTER VARYING(400)
95);
96
97--
98-- NAME: CR_RAPTOR_PDF_IMG; TYPE: TABLE
99--
100create table cr_raptor_pdf_img (
101 IMAGE_ID CHARACTER VARYING(100) NOT NULL,
102 IMAGE_LOC CHARACTER VARYING(400)
103);
104
105--
106-- NAME: CR_REMOTE_SCHEMA_INFO; TYPE: TABLE
107--
108create table cr_remote_schema_info (
109 SCHEMA_PREFIX CHARACTER VARYING(5) NOT NULL,
110 SCHEMA_DESC CHARACTER VARYING(75) NOT NULL,
111 DATASOURCE_TYPE CHARACTER VARYING(100)
112);
113
114--
115-- NAME: CR_REPORT; TYPE: TABLE
116--
117create table cr_report (
118 REP_ID NUMERIC(11,0) NOT NULL,
119 TITLE CHARACTER VARYING(100) NOT NULL,
120 DESCR CHARACTER VARYING(255),
121 PUBLIC_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL,
122 REPORT_XML TEXT,
123 CREATE_ID NUMERIC(11,0),
124 CREATE_DATE TIMESTAMP default now(),
125 MAINT_ID NUMERIC(11,0),
126 MAINT_DATE TIMESTAMP DEFAULT NOW(),
127 MENU_ID CHARACTER VARYING(500),
128 MENU_APPROVED_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL,
129 OWNER_ID NUMERIC(11,0),
130 FOLDER_ID INTEGER DEFAULT 0,
131 DASHBOARD_TYPE_YN CHARACTER VARYING(1) DEFAULT 'N',
132 DASHBOARD_YN CHARACTER VARYING(1) DEFAULT 'N'
133);
134
135--
136-- NAME: CR_REPORT_ACCESS; TYPE: TABLE
137--
138create table cr_report_access (
139 REP_ID NUMERIC(11,0) NOT NULL,
140 ORDER_NO NUMERIC(11,0) NOT NULL,
141 ROLE_ID NUMERIC(11,0),
142 USER_ID NUMERIC(11,0),
143 READ_ONLY_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL
144);
145
146--
147-- NAME: CR_REPORT_DWNLD_LOG; TYPE: TABLE
148--
149create table cr_report_dwnld_log (
150 USER_ID NUMERIC(11,0) NOT NULL,
151 REP_ID INTEGER NOT NULL,
152 FILE_NAME CHARACTER VARYING(100) NOT NULL,
153 DWNLD_START_TIME TIMESTAMP DEFAULT NOW() NOT NULL,
154 RECORD_READY_TIME TIMESTAMP DEFAULT NOW(),
155 FILTER_PARAMS CHARACTER VARYING(2000)
156);
157
158--
159-- NAME: CR_REPORT_EMAIL_SENT_LOG; TYPE: TABLE
160--
161create table cr_report_email_sent_log (
162 LOG_ID INTEGER NOT NULL,
163 SCHEDULE_ID NUMERIC(11,0),
164 GEN_KEY CHARACTER VARYING(25) NOT NULL,
165 REP_ID NUMERIC(11,0) NOT NULL,
166 USER_ID NUMERIC(11,0),
167 SENT_DATE TIMESTAMP DEFAULT NOW(),
168 ACCESS_FLAG CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL,
169 TOUCH_DATE TIMESTAMP DEFAULT NOW()
170);
171
172--
173-- NAME: CR_REPORT_FILE_HISTORY; TYPE: TABLE
174--
175create table cr_report_file_history (
176 HIST_ID INT(11) NOT NULL,
177 SCHED_USER_ID NUMERIC(11,0) NOT NULL,
178 SCHEDULE_ID NUMERIC(11,0) NOT NULL,
179 USER_ID NUMERIC(11,0) NOT NULL,
180 REP_ID NUMERIC(11,0),
181 RUN_DATE TIMESTAMP,
182 RECURRENCE CHARACTER VARYING(50),
183 FILE_TYPE_ID NUMERIC(2,0),
184 FILE_NAME CHARACTER VARYING(80),
185 FILE_BLOB BLOB,
186 FILE_SIZE NUMERIC(11,0),
187 RAPTOR_URL CHARACTER VARYING(4000),
188 ERROR_YN CHARACTER(1) DEFAULT 'N',
189 ERROR_CODE NUMERIC(11,0),
190 DELETED_YN CHARACTER(1) DEFAULT 'N',
191 DELETED_BY NUMERIC(38,0)
192);
193
194--
195-- NAME: CR_REPORT_LOG; TYPE: TABLE
196--
197create table cr_report_log (
198 REP_ID NUMERIC(11,0) NOT NULL,
199 LOG_TIME TIMESTAMP NOT NULL,
200 USER_ID NUMERIC(11,0) NOT NULL,
201 ACTION CHARACTER VARYING(2000) NOT NULL,
202 ACTION_VALUE CHARACTER VARYING(50),
203 FORM_FIELDS CHARACTER VARYING(4000)
204);
205
206--
207-- NAME: CR_REPORT_SCHEDULE; TYPE: TABLE
208--
209create table cr_report_schedule (
210 SCHEDULE_ID NUMERIC(11,0) NOT NULL,
211 SCHED_USER_ID NUMERIC(11,0) NOT NULL,
212 REP_ID NUMERIC(11,0) NOT NULL,
213 ENABLED_YN CHARACTER VARYING(1) NOT NULL,
214 START_DATE TIMESTAMP DEFAULT NOW(),
215 END_DATE TIMESTAMP DEFAULT NOW(),
216 RUN_DATE TIMESTAMP DEFAULT NOW(),
217 RECURRENCE CHARACTER VARYING(50),
218 CONDITIONAL_YN CHARACTER VARYING(1) NOT NULL,
219 CONDITION_SQL CHARACTER VARYING(4000),
220 NOTIFY_TYPE INTEGER DEFAULT 0,
221 MAX_ROW INTEGER DEFAULT 1000,
222 INITIAL_FORMFIELDS CHARACTER VARYING(3500),
223 PROCESSED_FORMFIELDS CHARACTER VARYING(3500),
224 FORMFIELDS CHARACTER VARYING(3500),
225 CONDITION_LARGE_SQL TEXT,
226 ENCRYPT_YN CHARACTER(1) DEFAULT 'N',
227 ATTACHMENT_YN CHARACTER(1) DEFAULT 'Y'
228);
229
230--
231-- NAME: CR_REPORT_SCHEDULE_USERS; TYPE: TABLE
232--
233create table cr_report_schedule_users (
234 SCHEDULE_ID NUMERIC(11,0) NOT NULL,
235 REP_ID NUMERIC(11,0) NOT NULL,
236 USER_ID NUMERIC(11,0) NOT NULL,
237 ROLE_ID NUMERIC(11,0),
238 ORDER_NO NUMERIC(11,0) NOT NULL
239);
240
241--
242-- NAME: CR_REPORT_TEMPLATE_MAP; TYPE: TABLE
243--
244create table cr_report_template_map (
245 REPORT_ID INTEGER NOT NULL,
246 TEMPLATE_FILE CHARACTER VARYING(200)
247);
248
249--
250-- NAME: CR_SCHEDULE_ACTIVITY_LOG; TYPE: TABLE
251--
252create table cr_schedule_activity_log (
253 SCHEDULE_ID NUMERIC(11,0) NOT NULL,
254 URL CHARACTER VARYING(4000),
255 NOTES CHARACTER VARYING(2000),
256 RUN_TIME TIMESTAMP
257);
258
259--
260-- NAME: CR_TABLE_JOIN; TYPE: TABLE
261--
262create table cr_table_join (
263 SRC_TABLE_NAME CHARACTER VARYING(30) NOT NULL,
264 DEST_TABLE_NAME CHARACTER VARYING(30) NOT NULL,
265 JOIN_EXPR CHARACTER VARYING(500) NOT NULL
266);
267
268--
269-- NAME: CR_TABLE_ROLE; TYPE: TABLE
270--
271create table cr_table_role (
272 TABLE_NAME CHARACTER VARYING(30) NOT NULL,
273 ROLE_ID NUMERIC(11,0) NOT NULL
274);
275
276--
277-- NAME: CR_TABLE_SOURCE; TYPE: TABLE
278--
279create table cr_table_source (
280 TABLE_NAME CHARACTER VARYING(30) NOT NULL,
281 DISPLAY_NAME CHARACTER VARYING(30) NOT NULL,
282 PK_FIELDS CHARACTER VARYING(200),
283 WEB_VIEW_ACTION CHARACTER VARYING(50),
284 LARGE_DATA_SOURCE_YN CHARACTER VARYING(1) DEFAULT 'N' NOT NULL,
285 FILTER_SQL CHARACTER VARYING(4000),
286 SOURCE_DB CHARACTER VARYING(50)
287);
288
289--
290-- NAME: FN_LU_TIMEZONE; TYPE: TABLE
291--
292create table fn_lu_timezone (
293 TIMEZONE_ID INT(11) NOT NULL,
294 TIMEZONE_NAME CHARACTER VARYING(100) NOT NULL,
295 TIMEZONE_VALUE CHARACTER VARYING(100) NOT NULL
296);
297
298create table fn_user (
299 USER_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
300 ORG_ID INT(11),
301 MANAGER_ID INT(11),
302 FIRST_NAME CHARACTER VARYING(50),
303 MIDDLE_NAME CHARACTER VARYING(50),
304 LAST_NAME CHARACTER VARYING(50),
305 PHONE CHARACTER VARYING(25),
306 FAX CHARACTER VARYING(25),
307 CELLULAR CHARACTER VARYING(25),
308 EMAIL CHARACTER VARYING(50),
309 ADDRESS_ID NUMERIC(11,0),
310 ALERT_METHOD_CD CHARACTER VARYING(10),
311 HRID CHARACTER VARYING(20),
312 ORG_USER_ID CHARACTER VARYING(20),
313 ORG_CODE CHARACTER VARYING(30),
314 LOGIN_ID CHARACTER VARYING(25),
315 LOGIN_PWD CHARACTER VARYING(25),
316 LAST_LOGIN_DATE TIMESTAMP,
317 ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL,
318 CREATED_ID INT(11),
319 CREATED_DATE TIMESTAMP DEFAULT NOW(),
320 MODIFIED_ID INT(11),
321 MODIFIED_DATE TIMESTAMP default now(),
322 IS_INTERNAL_YN CHARACTER(1) DEFAULT 'N' NOT NULL,
323 ADDRESS_LINE_1 CHARACTER VARYING(100),
324 ADDRESS_LINE_2 CHARACTER VARYING(100),
325 CITY CHARACTER VARYING(50),
326 STATE_CD CHARACTER VARYING(3),
327 ZIP_CODE CHARACTER VARYING(11),
328 COUNTRY_CD CHARACTER VARYING(3),
329 LOCATION_CLLI CHARACTER VARYING(8),
330 ORG_MANAGER_USERID CHARACTER VARYING(20),
331 COMPANY CHARACTER VARYING(100),
332 DEPARTMENT_NAME CHARACTER VARYING(100),
333 JOB_TITLE CHARACTER VARYING(100),
334 TIMEZONE INT(11),
335 DEPARTMENT CHARACTER VARYING(25),
336 BUSINESS_UNIT CHARACTER VARYING(25),
337 BUSINESS_UNIT_NAME CHARACTER VARYING(100),
338 COST_CENTER CHARACTER VARYING(25),
339 FIN_LOC_CODE CHARACTER VARYING(10),
340 SILO_STATUS CHARACTER VARYING(10)
341);
342
343--
344-- NAME: FN_ROLE; TYPE: TABLE
345--
346create table fn_role (
347 ROLE_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
348 ROLE_NAME CHARACTER VARYING(50) NOT NULL,
349 ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL,
350 PRIORITY NUMERIC(4,0)
351);
352
353--
354-- NAME: FN_AUDIT_ACTION; TYPE: TABLE
355--
356create table fn_audit_action (
357 AUDIT_ACTION_ID INTEGER NOT NULL,
358 CLASS_NAME CHARACTER VARYING(500) NOT NULL,
359 METHOD_NAME CHARACTER VARYING(50) NOT NULL,
360 AUDIT_ACTION_CD CHARACTER VARYING(20) NOT NULL,
361 AUDIT_ACTION_DESC CHARACTER VARYING(200),
362 ACTIVE_YN CHARACTER VARYING(1)
363);
364
365--
366-- NAME: FN_AUDIT_ACTION_LOG; TYPE: TABLE
367--
368create table fn_audit_action_log (
369 AUDIT_LOG_ID INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
370 AUDIT_ACTION_CD CHARACTER VARYING(200),
371 ACTION_TIME TIMESTAMP,
372 USER_ID NUMERIC(11,0),
373 CLASS_NAME CHARACTER VARYING(100),
374 METHOD_NAME CHARACTER VARYING(50),
375 SUCCESS_MSG CHARACTER VARYING(20),
376 ERROR_MSG CHARACTER VARYING(500)
377);
378
379--
380-- NAME: FN_LU_ACTIVITY; TYPE: TABLE
381--
382create table fn_lu_activity (
383 ACTIVITY_CD CHARACTER VARYING(50) NOT NULL PRIMARY KEY,
384 ACTIVITY CHARACTER VARYING(50) NOT NULL
385);
386
387--
388-- NAME: FN_AUDIT_LOG; TYPE: TABLE
389--
390create table fn_audit_log (
391 LOG_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
392 USER_ID INT(11) NOT NULL,
393 ACTIVITY_CD CHARACTER VARYING(50) NOT NULL,
394 AUDIT_DATE TIMESTAMP DEFAULT NOW() NOT NULL,
395 COMMENTS CHARACTER VARYING(1000),
396 AFFECTED_RECORD_ID_BK CHARACTER VARYING(500),
397 AFFECTED_RECORD_ID CHARACTER VARYING(4000),
398 CONSTRAINT FK_FN_AUDIT_REF_209_FN_USER FOREIGN KEY (USER_ID) REFERENCES FN_USER(USER_ID)
399);
400
401--
402-- NAME: FN_BROADCAST_MESSAGE; TYPE: TABLE
403--
404create table fn_broadcast_message (
405 MESSAGE_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
406 MESSAGE_TEXT CHARACTER VARYING(1000) NOT NULL,
407 MESSAGE_LOCATION_ID NUMERIC(11,0) NOT NULL,
408 BROADCAST_START_DATE TIMESTAMP NOT NULL DEFAULT NOW(),
409 BROADCAST_END_DATE TIMESTAMP NOT NULL DEFAULT NOW(),
410 ACTIVE_YN CHARACTER(1) DEFAULT 'Y' NOT NULL,
411 SORT_ORDER NUMERIC(4,0) NOT NULL,
412 BROADCAST_SITE_CD CHARACTER VARYING(50)
413);
414
415--
416-- NAME: FN_CHAT_LOGS; TYPE: TABLE
417--
418create table fn_chat_logs (
419 CHAT_LOG_ID INTEGER NOT NULL,
420 CHAT_ROOM_ID INTEGER,
421 USER_ID INTEGER,
422 MESSAGE CHARACTER VARYING(1000),
423 MESSAGE_DATE_TIME TIMESTAMP
424);
425
426--
427-- NAME: FN_CHAT_ROOM; TYPE: TABLE
428--
429create table fn_chat_room (
430 CHAT_ROOM_ID INTEGER NOT NULL,
431 NAME CHARACTER VARYING(50) NOT NULL,
432 DESCRIPTION CHARACTER VARYING(500),
433 OWNER_ID INTEGER,
434 CREATED_DATE TIMESTAMP DEFAULT NOW(),
435 UPDATED_DATE TIMESTAMP DEFAULT NOW()
436);
437
438--
439-- NAME: FN_CHAT_USERS; TYPE: TABLE
440--
441create table fn_chat_users (
442 CHAT_ROOM_ID INTEGER,
443 USER_ID INTEGER,
444 LAST_ACTIVITY_DATE_TIME TIMESTAMP,
445 CHAT_STATUS CHARACTER VARYING(20),
446 ID INTEGER NOT NULL
447);
448
449--
450-- NAME: FN_DATASOURCE; TYPE: TABLE
451--
452create table fn_datasource (
453 ID INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
454 NAME CHARACTER VARYING(50),
455 DRIVER_NAME CHARACTER VARYING(256),
456 SERVER CHARACTER VARYING(256),
457 PORT INTEGER,
458 USER_NAME CHARACTER VARYING(256),
459 PASSWORD CHARACTER VARYING(256),
460 URL CHARACTER VARYING(256),
461 MIN_POOL_SIZE INTEGER,
462 MAX_POOL_SIZE INTEGER,
463 ADAPTER_ID INTEGER,
464 DS_TYPE CHARACTER VARYING(20)
465);
466
467--
468-- NAME: FN_FUNCTION; TYPE: TABLE
469--
470create table fn_function (
471 FUNCTION_CD CHARACTER VARYING(30) NOT NULL PRIMARY KEY,
472 FUNCTION_NAME CHARACTER VARYING(50) NOT NULL
473);
474
475--
476-- NAME: FN_LU_ALERT_METHOD; TYPE: TABLE
477--
478create table fn_lu_alert_method (
479 ALERT_METHOD_CD CHARACTER VARYING(10) NOT NULL,
480 ALERT_METHOD CHARACTER VARYING(50) NOT NULL
481);
482
483--
484-- NAME: FN_LU_BROADCAST_SITE; TYPE: TABLE
485--
486create table fn_lu_broadcast_site (
487 BROADCAST_SITE_CD CHARACTER VARYING(50) NOT NULL,
488 BROADCAST_SITE_DESCR CHARACTER VARYING(100)
489);
490--
491-- NAME: FN_LU_MENU_SET; TYPE: TABLE
492--
493create table fn_lu_menu_set (
494 MENU_SET_CD CHARACTER VARYING(10) NOT NULL PRIMARY KEY,
495 MENU_SET_NAME CHARACTER VARYING(50) NOT NULL
496);
497
498--
499-- NAME: FN_LU_PRIORITY; TYPE: TABLE
500--
501create table fn_lu_priority (
502 PRIORITY_ID NUMERIC(11,0) NOT NULL,
503 PRIORITY CHARACTER VARYING(50) NOT NULL,
504 ACTIVE_YN CHARACTER(1) NOT NULL,
505 SORT_ORDER NUMERIC(5,0)
506);
507
508--
509-- NAME: FN_LU_ROLE_TYPE; TYPE: TABLE
510--
511create table fn_lu_role_type (
512 ROLE_TYPE_ID NUMERIC(11,0) NOT NULL,
513 ROLE_TYPE CHARACTER VARYING(50) NOT NULL
514);
515--
516-- NAME: FN_LU_TAB_SET; TYPE: TABLE
517--
518create table fn_lu_tab_set (
519 TAB_SET_CD CHARACTER VARYING(30) NOT NULL,
520 TAB_SET_NAME CHARACTER VARYING(50) NOT NULL
521);
522
523--
524-- NAME: FN_MENU; TYPE: TABLE
525--
526create table fn_menu (
527 MENU_ID INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
528 LABEL CHARACTER VARYING(100),
529 PARENT_ID INT(11),
530 SORT_ORDER NUMERIC(4,0),
531 ACTION CHARACTER VARYING(200),
532 FUNCTION_CD CHARACTER VARYING(30),
533 ACTIVE_YN CHARACTER VARYING(1) DEFAULT 'Y' NOT NULL,
534 SERVLET CHARACTER VARYING(50),
535 QUERY_STRING CHARACTER VARYING(200),
536 EXTERNAL_URL CHARACTER VARYING(200),
537 TARGET CHARACTER VARYING(25),
538 MENU_SET_CD CHARACTER VARYING(10) DEFAULT 'APP',
539 SEPARATOR_YN CHARACTER(1) DEFAULT 'N',
540 IMAGE_SRC CHARACTER VARYING(100),
541 CONSTRAINT FK_FN_MENU_REF_196_FN_MENU FOREIGN KEY (PARENT_ID) REFERENCES FN_MENU(MENU_ID),
542 CONSTRAINT FK_FN_MENU_MENU_SET_CD FOREIGN KEY (MENU_SET_CD) REFERENCES FN_LU_MENU_SET(MENU_SET_CD),
543 CONSTRAINT FK_FN_MENU_REF_223_FN_FUNCT FOREIGN KEY (FUNCTION_CD) REFERENCES FN_FUNCTION(FUNCTION_CD)
544);
545
546--
547-- NAME: FN_ORG; TYPE: TABLE
548--
549create table fn_org (
550 ORG_ID INT(11) NOT NULL,
551 ORG_NAME CHARACTER VARYING(50) NOT NULL,
552 ACCESS_CD CHARACTER VARYING(10)
553);
554
555--
556-- NAME: FN_RESTRICTED_URL; TYPE: TABLE
557--
558create table fn_restricted_url (
559 RESTRICTED_URL CHARACTER VARYING(250) NOT NULL,
560 FUNCTION_CD CHARACTER VARYING(30) NOT NULL
561);
562
563--
564-- NAME: FN_ROLE_COMPOSITE; TYPE: TABLE
565--
566create table fn_role_composite (
567 PARENT_ROLE_ID INT(11) NOT NULL,
568 CHILD_ROLE_ID INT(11) NOT NULL,
569 CONSTRAINT FK_FN_ROLE_COMPOSITE_CHILD FOREIGN KEY (CHILD_ROLE_ID) REFERENCES FN_ROLE(ROLE_ID),
570 CONSTRAINT FK_FN_ROLE_COMPOSITE_PARENT FOREIGN KEY (PARENT_ROLE_ID) REFERENCES FN_ROLE(ROLE_ID)
571);
572
573--
574-- NAME: FN_ROLE_FUNCTION; TYPE: TABLE
575--
576create table fn_role_function (
577 ROLE_ID INT(11) NOT NULL,
578 FUNCTION_CD CHARACTER VARYING(30) NOT NULL,
579 CONSTRAINT FK_FN_ROLE__REF_198_FN_ROLE FOREIGN KEY (ROLE_ID) REFERENCES FN_ROLE(ROLE_ID)
580);
581
582--
583-- NAME: FN_TAB; TYPE: TABLE
584--
585create table fn_tab (
586 TAB_CD CHARACTER VARYING(30) NOT NULL,
587 TAB_NAME CHARACTER VARYING(50) NOT NULL,
588 TAB_DESCR CHARACTER VARYING(100),
589 ACTION CHARACTER VARYING(100) NOT NULL,
590 FUNCTION_CD CHARACTER VARYING(30) NOT NULL,
591 ACTIVE_YN CHARACTER(1) NOT NULL,
592 SORT_ORDER NUMERIC(11,0) NOT NULL,
593 PARENT_TAB_CD CHARACTER VARYING(30),
594 TAB_SET_CD CHARACTER VARYING(30)
595);
596
597--
598-- NAME: FN_TAB_SELECTED; TYPE: TABLE
599--
600create table fn_tab_selected (
601 SELECTED_TAB_CD CHARACTER VARYING(30) NOT NULL,
602 TAB_URI CHARACTER VARYING(40) NOT NULL
603);
604
605--
606-- NAME: FN_USER_PSEUDO_ROLE; TYPE: TABLE
607--
608create table fn_user_pseudo_role (
609 PSEUDO_ROLE_ID INT(11) NOT NULL,
610 USER_ID INT(11) NOT NULL
611);
612
613--
614-- NAME: FN_USER_ROLE; TYPE: TABLE
615--
616create table fn_user_role (
617 USER_ID INT(10) NOT NULL,
618 ROLE_ID INT(10) NOT NULL,
619 PRIORITY NUMERIC(4,0),
620 APP_ID INT(11) DEFAULT 1,
621 CONSTRAINT FK_FN_USER__REF_172_FN_USER FOREIGN KEY (USER_ID) REFERENCES FN_USER(USER_ID),
622 CONSTRAINT FK_FN_USER__REF_175_FN_ROLE FOREIGN KEY (ROLE_ID) REFERENCES FN_ROLE(ROLE_ID)
623);
624--
625-- NAME: SCHEMA_INFO; TYPE: TABLE
626--
627create table schema_info (
628 SCHEMA_ID CHARACTER VARYING(25) NOT NULL,
629 SCHEMA_DESC CHARACTER VARYING(75) NOT NULL,
630 DATASOURCE_TYPE CHARACTER VARYING(100),
631 CONNECTION_URL VARCHAR(200) NOT NULL,
632 USER_NAME VARCHAR(45) NOT NULL,
633 PASSWORD VARCHAR(45) NULL DEFAULT NULL,
634 DRIVER_CLASS VARCHAR(100) NOT NULL,
635 MIN_POOL_SIZE INT NOT NULL,
636 MAX_POOL_SIZE INT NOT NULL,
637 IDLE_CONNECTION_TEST_PERIOD INT NOT NULL
638
639);
640
641-- ----------------------------------------------------------
642-- NAME: FN_APP; TYPE: TABLE
643-- ----------------------------------------------------------
644create table fn_app (
645 APP_ID int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
646 APP_NAME varchar(100) NOT NULL DEFAULT '?',
647 APP_IMAGE_URL varchar(256) DEFAULT NULL,
648 APP_DESCRIPTION varchar(512) DEFAULT NULL,
649 APP_NOTES varchar(4096) DEFAULT NULL,
650 APP_URL varchar(256) DEFAULT NULL,
651 APP_ALTERNATE_URL varchar(256) DEFAULT NULL,
652 APP_REST_ENDPOINT varchar(2000) DEFAULT NULL,
653 ML_APP_NAME varchar(50) NOT NULL DEFAULT '?',
654 ML_APP_ADMIN_ID varchar(7) NOT NULL DEFAULT '?',
655 MOTS_ID int(11) DEFAULT NULL,
656 APP_PASSWORD varchar(256) NOT NULL DEFAULT '?',
657 OPEN char(1) DEFAULT 'N',
658 ENABLED char(1) DEFAULT 'Y',
659 THUMBNAIL mediumblob,
660 APP_USERNAME varchar(50),
661 UEB_KEY VARCHAR(256) DEFAULT NULL,
662 UEB_SECRET VARCHAR(256) DEFAULT NULL,
663 UEB_TOPIC_NAME VARCHAR(256) DEFAULT NULL
664
665);
666
667-- ----------------------------------------------------------
668-- NAME: FN_FN_WORKFLOW; TYPE: TABLE
669-- ----------------------------------------------------------
670create table fn_workflow (
671 id mediumint(9) NOT NULL AUTO_INCREMENT,
672 name varchar(20) NOT NULL,
673 description varchar(500) DEFAULT NULL,
674 run_link varchar(300) DEFAULT NULL,
675 suspend_link varchar(300) DEFAULT NULL,
676 modified_link varchar(300) DEFAULT NULL,
677 active_yn varchar(300) DEFAULT NULL,
678 created varchar(300) DEFAULT NULL,
679 created_by int(11) DEFAULT NULL,
680 modified varchar(300) DEFAULT NULL,
681 modified_by int(11) DEFAULT NULL,
682 workflow_key varchar(50) DEFAULT NULL,
683 PRIMARY KEY (id),
684 UNIQUE KEY name (name)
685);
686
687-- ----------------------------------------------------------
688-- NAME: FN_SCHEDULE_WORKFLOWS; TYPE: TABLE
689-- ----------------------------------------------------------
690create table fn_schedule_workflows (
691 id_schedule_workflows bigint(25) PRIMARY KEY NOT NULL AUTO_INCREMENT,
692 workflow_server_url varchar(45) DEFAULT NULL,
693 workflow_key varchar(45) NOT NULL,
694 workflow_arguments varchar(45) DEFAULT NULL,
695 startDateTimeCron varchar(45) DEFAULT NULL,
696 endDateTime TIMESTAMP DEFAULT NOW(),
697 start_date_time TIMESTAMP DEFAULT NOW(),
698 recurrence varchar(45) DEFAULT NULL
699 );
700
701-- For demo reporting application add : demo_bar_chart, demo_bar_chart_inter, demo_line_chart, demo_pie_chart and demo_util_chart
702-- demo_scatter_chart, demo_scatter_plot
703-- ----------------------------------------------------------
704-- NAME: DEMO_BAR_CHART; TYPE: TABLE
705-- ----------------------------------------------------------
706create table demo_bar_chart (
707 label varchar(20),
708 value numeric(25,15)
709 );
710
711-- ----------------------------------------------------------
712-- NAME: DEMO_BAR_CHART_INTER; TYPE: TABLE
713-- ----------------------------------------------------------
714create table demo_bar_chart_inter (
715 spam_date date,
716 num_rpt_sources numeric(10,0),
717 num_det_sources numeric(10,0)
718 );
719
720-- ----------------------------------------------------------
721-- NAME: DEMO_LINE_CHART; TYPE: TABLE
722-- ----------------------------------------------------------
723create table demo_line_chart (
724 series varchar(20),
725 log_date date,
726 data_value numeric(10,5)
727 );
728
729-- ----------------------------------------------------------
730-- NAME: DEMO_PIE_CHART; TYPE: TABLE
731-- ----------------------------------------------------------
732create table demo_pie_chart (
733 legend varchar(20),
734 data_value numeric(10,5)
735 );
736
737-- ----------------------------------------------------------
738-- NAME: DEMO_UTIL_CHART; TYPE: TABLE
739-- ----------------------------------------------------------
740create table demo_util_chart (
741 traffic_date date,
742 util_perc numeric(10,5)
743 );
744
745-- ----------------------------------------------------------
746-- NAME: DEMO_SCATTER_CHART; TYPE: TABLE
747-- ----------------------------------------------------------
748create table demo_scatter_chart (
749 rainfall numeric(10,2),
750 key_value varchar(20),
751 measurements numeric(10,2)
752);
753
754-- ----------------------------------------------------------
755-- NAME: DEMO_SCATTER_PLOT; TYPE: TABLE
756-- ----------------------------------------------------------
757create table demo_scatter_plot
758(
759 SERIES VARCHAR(20),
760 VALUEX numeric(25,15),
761 VALUEY numeric(25,15)
762);
763
764-- ----------------------------------------------------------
765-- NAME: FN_QZ_JOB_DETAILS; TYPE: TABLE
766-- ----------------------------------------------------------
767create table fn_qz_job_details (
768SCHED_NAME VARCHAR(120) NOT NULL,
769JOB_NAME VARCHAR(200) NOT NULL,
770JOB_GROUP VARCHAR(200) NOT NULL,
771DESCRIPTION VARCHAR(250) NULL,
772JOB_CLASS_NAME VARCHAR(250) NOT NULL,
773IS_DURABLE VARCHAR(1) NOT NULL,
774IS_NONCONCURRENT VARCHAR(1) NOT NULL,
775IS_UPDATE_DATA VARCHAR(1) NOT NULL,
776REQUESTS_RECOVERY VARCHAR(1) NOT NULL,
777JOB_DATA BLOB NULL,
778PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
779);
780
781-- ----------------------------------------------------------
782-- NAME: FN_QZ_TRIGGERS; TYPE: TABLE
783-- ----------------------------------------------------------
784create table fn_qz_triggers (
785SCHED_NAME VARCHAR(120) NOT NULL,
786TRIGGER_NAME VARCHAR(200) NOT NULL,
787TRIGGER_GROUP VARCHAR(200) NOT NULL,
788JOB_NAME VARCHAR(200) NOT NULL,
789JOB_GROUP VARCHAR(200) NOT NULL,
790DESCRIPTION VARCHAR(250) NULL,
791NEXT_FIRE_TIME BIGINT(13) NULL,
792PREV_FIRE_TIME BIGINT(13) NULL,
793PRIORITY INTEGER NULL,
794TRIGGER_STATE VARCHAR(16) NOT NULL,
795TRIGGER_TYPE VARCHAR(8) NOT NULL,
796START_TIME BIGINT(13) NOT NULL,
797END_TIME BIGINT(13) NULL,
798CALENDAR_NAME VARCHAR(200) NULL,
799MISFIRE_INSTR SMALLINT(2) NULL,
800JOB_DATA BLOB NULL,
801PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
802FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
803REFERENCES FN_QZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
804);
805
806-- ----------------------------------------------------------
807-- NAME: FN_QZ_SIMPLE_TRIGGERS; TYPE: TABLE
808-- ----------------------------------------------------------
809create table fn_qz_simple_triggers (
810SCHED_NAME VARCHAR(120) NOT NULL,
811TRIGGER_NAME VARCHAR(200) NOT NULL,
812TRIGGER_GROUP VARCHAR(200) NOT NULL,
813REPEAT_COUNT BIGINT(7) NOT NULL,
814REPEAT_INTERVAL BIGINT(12) NOT NULL,
815TIMES_TRIGGERED BIGINT(10) NOT NULL,
816PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
817FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
818REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
819);
820
821-- ----------------------------------------------------------
822-- NAME: FN_QZ_CRON_TRIGGERS; TYPE: TABLE
823-- ----------------------------------------------------------
824create table fn_qz_cron_triggers (
825SCHED_NAME VARCHAR(120) NOT NULL,
826TRIGGER_NAME VARCHAR(200) NOT NULL,
827TRIGGER_GROUP VARCHAR(200) NOT NULL,
828CRON_EXPRESSION VARCHAR(120) NOT NULL,
829TIME_ZONE_ID VARCHAR(80),
830PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
831FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
832REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
833);
834
835-- ----------------------------------------------------------
836-- NAME: FN_QZ_SIMPROP_TRIGGERS; TYPE: TABLE
837-- ----------------------------------------------------------
838create table fn_qz_simprop_triggers
839 (
840 SCHED_NAME VARCHAR(120) NOT NULL,
841 TRIGGER_NAME VARCHAR(200) NOT NULL,
842 TRIGGER_GROUP VARCHAR(200) NOT NULL,
843 STR_PROP_1 VARCHAR(512) NULL,
844 STR_PROP_2 VARCHAR(512) NULL,
845 STR_PROP_3 VARCHAR(512) NULL,
846 INT_PROP_1 INT NULL,
847 INT_PROP_2 INT NULL,
848 LONG_PROP_1 BIGINT NULL,
849 LONG_PROP_2 BIGINT NULL,
850 DEC_PROP_1 NUMERIC(13,4) NULL,
851 DEC_PROP_2 NUMERIC(13,4) NULL,
852 BOOL_PROP_1 VARCHAR(1) NULL,
853 BOOL_PROP_2 VARCHAR(1) NULL,
854 PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
855 FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
856 REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
857);
858
859-- ----------------------------------------------------------
860-- NAME: FN_QZ_BLOB_TRIGGERS; TYPE: TABLE
861-- ----------------------------------------------------------
862create table fn_qz_blob_triggers (
863SCHED_NAME VARCHAR(120) NOT NULL,
864TRIGGER_NAME VARCHAR(200) NOT NULL,
865TRIGGER_GROUP VARCHAR(200) NOT NULL,
866BLOB_DATA BLOB NULL,
867PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
868INDEX (SCHED_NAME,TRIGGER_NAME, TRIGGER_GROUP),
869FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
870REFERENCES FN_QZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
871);
872
873-- ----------------------------------------------------------
874-- NAME: FN_QZ_CALENDARS; TYPE: TABLE
875-- ----------------------------------------------------------
876create table fn_qz_calendars (
877SCHED_NAME VARCHAR(120) NOT NULL,
878CALENDAR_NAME VARCHAR(200) NOT NULL,
879CALENDAR BLOB NOT NULL,
880PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
881);
882
883-- ----------------------------------------------------------
884-- NAME: FN_QZ_PAUSED_TRIGGER_GRPS; TYPE: TABLE
885-- ----------------------------------------------------------
886create table fn_qz_paused_trigger_grps (
887SCHED_NAME VARCHAR(120) NOT NULL,
888TRIGGER_GROUP VARCHAR(200) NOT NULL,
889PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
890);
891
892-- ----------------------------------------------------------
893-- NAME: FN_QZ_FIRED_TRIGGERS; TYPE: TABLE
894-- ----------------------------------------------------------
895create table fn_qz_fired_triggers (
896SCHED_NAME VARCHAR(120) NOT NULL,
897ENTRY_ID VARCHAR(95) NOT NULL,
898TRIGGER_NAME VARCHAR(200) NOT NULL,
899TRIGGER_GROUP VARCHAR(200) NOT NULL,
900INSTANCE_NAME VARCHAR(200) NOT NULL,
901FIRED_TIME BIGINT(13) NOT NULL,
902SCHED_TIME BIGINT(13) NOT NULL,
903PRIORITY INTEGER NOT NULL,
904STATE VARCHAR(16) NOT NULL,
905JOB_NAME VARCHAR(200) NULL,
906JOB_GROUP VARCHAR(200) NULL,
907IS_NONCONCURRENT VARCHAR(1) NULL,
908REQUESTS_RECOVERY VARCHAR(1) NULL,
909PRIMARY KEY (SCHED_NAME,ENTRY_ID)
910);
911
912-- ----------------------------------------------------------
913-- NAME: FN_QZ_SCHEDULER_STATE; TYPE: TABLE
914-- ----------------------------------------------------------
915create table fn_qz_scheduler_state (
916SCHED_NAME VARCHAR(120) NOT NULL,
917INSTANCE_NAME VARCHAR(200) NOT NULL,
918LAST_CHECKIN_TIME BIGINT(13) NOT NULL,
919CHECKIN_INTERVAL BIGINT(13) NOT NULL,
920PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
921);
922
923-- ----------------------------------------------------------
924-- NAME: FN_QZ_LOCKS; TYPE: TABLE
925-- ----------------------------------------------------------
926create table fn_qz_locks (
927SCHED_NAME VARCHAR(120) NOT NULL,
928LOCK_NAME VARCHAR(40) NOT NULL,
929PRIMARY KEY (SCHED_NAME,LOCK_NAME)
930);
931
932--
933-- name: rcloudinvocation; type: table
934--
935create table rcloudinvocation (
936 id varchar(128) not null primary key,
937 created timestamp not null,
938 userinfo varchar(2048) not null,
939 notebookid varchar(128) not null,
940 parameters varchar(2048) default null,
941 tokenreaddate timestamp null
942);
943
944--
945-- name: rcloudnotebook; type: table
946--
947create table rcloudnotebook (
948 notebookname varchar(128) not null primary key,
949 notebookid varchar(128) not null
950);
951
952--
953-- Name: fn_lu_message_location; Type: TABLE
954--
955
956CREATE TABLE fn_lu_message_location (
957 message_location_id numeric(11,0) NOT NULL,
958 message_location_descr character varying(30) NOT NULL
959);
960
961-- ------------------ CREATE VIEW SECTION
962--
963-- NAME: V_URL_ACCESS; TYPE: VIEW
964--
965CREATE VIEW v_url_access AS
966 SELECT DISTINCT M.ACTION AS URL,
967 M.FUNCTION_CD
968 FROM FN_MENU M
969 WHERE (M.ACTION IS NOT NULL)
970UNION
971 SELECT DISTINCT T.ACTION AS URL,
972 T.FUNCTION_CD
973 FROM FN_TAB T
974 WHERE (T.ACTION IS NOT NULL)
975UNION
976 SELECT R.RESTRICTED_URL AS URL,
977 R.FUNCTION_CD
978 FROM FN_RESTRICTED_URL R;
979
980-- ------------------ ALTER TABLE ADD CONSTRAINT PRIMARY KEY SECTION
981--
982-- NAME: CR_FAVORITE_REPORTS_USER_IDREP_ID; TYPE: CONSTRAINT
983--
984alter table cr_favorite_reports
985 add constraint cr_favorite_reports_user_idrep_id primary key (user_id, rep_id);
986--
987-- NAME: CR_FOLDER_FOLDER_ID; TYPE: CONSTRAINT
988--
989alter table cr_folder
990 add constraint cr_folder_folder_id primary key (folder_id);
991--
992-- NAME: CR_FOLDER_ACCESS_FOLDER_ACCESS_ID; TYPE: CONSTRAINT
993--
994alter table cr_folder_access
995 add constraint cr_folder_access_folder_access_id primary key (folder_access_id);
996--
997-- NAME: CR_HIST_USER_MAP_HIST_IDUSER_ID; TYPE: CONSTRAINT
998--
999alter table cr_hist_user_map
1000 add constraint cr_hist_user_map_hist_iduser_id primary key (hist_id, user_id);
1001--
1002-- NAME: CR_LU_FILE_TYPE_LOOKUP_ID; TYPE: CONSTRAINT
1003--
1004alter table cr_lu_file_type
1005 add constraint cr_lu_file_type_lookup_id primary key (lookup_id);
1006--
1007-- NAME: CR_RAPTOR_ACTION_IMG_IMAGE_ID; TYPE: CONSTRAINT
1008--
1009alter table cr_raptor_action_img
1010 add constraint cr_raptor_action_img_image_id primary key (image_id);
1011--
1012-- NAME: CR_RAPTOR_PDF_IMG_IMAGE_ID; TYPE: CONSTRAINT
1013--
1014alter table cr_raptor_pdf_img
1015 add constraint cr_raptor_pdf_img_image_id primary key (image_id);
1016--
1017-- NAME: CR_REMOTE_SCHEMA_INFO_SCHEMA_PREFIX; TYPE: CONSTRAINT
1018--
1019alter table cr_remote_schema_info
1020 add constraint cr_remote_schema_info_schema_prefix primary key (schema_prefix);
1021--
1022-- NAME: CR_REPORT_REP_ID; TYPE: CONSTRAINT
1023--
1024alter table cr_report
1025 add constraint cr_report_rep_id primary key (rep_id);
1026--
1027-- NAME: CR_REPORT_ACCESS_REP_IDORDER_NO; TYPE: CONSTRAINT
1028--
1029alter table cr_report_access
1030 add constraint cr_report_access_rep_idorder_no primary key (rep_id, order_no);
1031--
1032-- NAME: CR_REPORT_EMAIL_SENT_LOG_LOG_ID; TYPE: CONSTRAINT
1033--
1034alter table cr_report_email_sent_log
1035 add constraint cr_report_email_sent_log_log_id primary key (log_id);
1036--
1037-- NAME: CR_REPORT_FILE_HISTORY_HIST_ID; TYPE: CONSTRAINT
1038--
1039alter table cr_report_file_history
1040 add constraint cr_report_file_history_hist_id primary key (hist_id);
1041--
1042-- NAME: CR_REPORT_SCHEDULE_SCHEDULE_ID; TYPE: CONSTRAINT
1043--
1044alter table cr_report_schedule
1045 add constraint cr_report_schedule_schedule_id primary key (schedule_id);
1046--
1047-- NAME: CR_REPORT_SCHEDULE_USERS_SCHEDULE_IDREP_IDUSER_IDORDER_NO; TYPE: CONSTRAINT
1048--
1049alter table cr_report_schedule_users
1050 add constraint cr_report_schedule_users_schedule_idrep_iduser_idorder_no primary key (schedule_id, rep_id, user_id, order_no);
1051--
1052-- NAME: CR_REPORT_TEMPLATE_MAP_REPORT_ID; TYPE: CONSTRAINT
1053--
1054alter table cr_report_template_map
1055 add constraint cr_report_template_map_report_id primary key (report_id);
1056--
1057-- NAME: CR_TABLE_ROLE_TABLE_NAMEROLE_ID; TYPE: CONSTRAINT
1058--
1059alter table cr_table_role
1060 add constraint cr_table_role_table_namerole_id primary key (table_name, role_id);
1061--
1062-- NAME: CR_TABLE_SOURCE_TABLE_NAME; TYPE: CONSTRAINT
1063--
1064alter table cr_table_source
1065 add constraint cr_table_source_table_name primary key (table_name);
1066--
1067-- NAME: FN_AUDIT_ACTION_AUDIT_ACTION_ID; TYPE: CONSTRAINT
1068--
1069alter table fn_audit_action
1070 add constraint fn_audit_action_audit_action_id primary key (audit_action_id);
1071--
1072-- NAME: FN_CHAT_LOGS_CHAT_LOG_ID; TYPE: CONSTRAINT
1073--
1074alter table fn_chat_logs
1075 add constraint fn_chat_logs_chat_log_id primary key (chat_log_id);
1076--
1077-- NAME: FN_CHAT_ROOM_CHAT_ROOM_ID; TYPE: CONSTRAINT
1078--
1079alter table fn_chat_room
1080 add constraint fn_chat_room_chat_room_id primary key (chat_room_id);
1081--
1082-- NAME: FN_CHAT_USERS_ID; TYPE: CONSTRAINT
1083--
1084alter table fn_chat_users
1085 add constraint fn_chat_users_id primary key (id);
1086--
1087-- NAME: FN_LU_ALERT_METHOD_ALERT_METHOD_CD; TYPE: CONSTRAINT
1088--
1089alter table fn_lu_alert_method
1090 add constraint fn_lu_alert_method_alert_method_cd primary key (alert_method_cd);
1091--
1092-- NAME: FN_LU_BROADCAST_SITE_BROADCAST_SITE_CD; TYPE: CONSTRAINT
1093--
1094alter table fn_lu_broadcast_site
1095 add constraint fn_lu_broadcast_site_broadcast_site_cd primary key (broadcast_site_cd);
1096--
1097-- NAME: FN_LU_PRIORITY_PRIORITY_ID; TYPE: CONSTRAINT
1098--
1099alter table fn_lu_priority
1100 add constraint fn_lu_priority_priority_id primary key (priority_id);
1101--
1102-- NAME: FN_LU_ROLE_TYPE_ROLE_TYPE_ID; TYPE: CONSTRAINT
1103--
1104alter table fn_lu_role_type
1105 add constraint fn_lu_role_type_role_type_id primary key (role_type_id);
1106--
1107-- NAME: FN_LU_TAB_SET_TAB_SET_CD; TYPE: CONSTRAINT
1108--
1109alter table fn_lu_tab_set
1110 add constraint fn_lu_tab_set_tab_set_cd primary key (tab_set_cd);
1111--
1112-- NAME: FN_LU_TIMEZONE_TIMEZONE_ID; TYPE: CONSTRAINT
1113--
1114alter table fn_lu_timezone
1115 add constraint fn_lu_timezone_timezone_id primary key (timezone_id);
1116--
1117-- NAME: FN_ORG_ORG_ID; TYPE: CONSTRAINT
1118--
1119alter table fn_org
1120 add constraint fn_org_org_id primary key (org_id);
1121--
1122-- NAME: FN_RESTRICTED_URL_RESTRICTED_URLFUNCTION_CD; TYPE: CONSTRAINT
1123--
1124alter table fn_restricted_url
1125 add constraint fn_restricted_url_restricted_urlfunction_cd primary key (restricted_url, function_cd);
1126--
1127-- NAME: FN_ROLE_COMPOSITE_PARENT_ROLE_IDCHILD_ROLE_ID; TYPE: CONSTRAINT
1128--
1129alter table fn_role_composite
1130 add constraint fn_role_composite_parent_role_idchild_role_id primary key (parent_role_id, child_role_id);
1131--
1132-- NAME: FN_ROLE_FUNCTION_ROLE_IDFUNCTION_CD; TYPE: CONSTRAINT
1133--
1134alter table fn_role_function
1135 add constraint fn_role_function_role_idfunction_cd primary key (role_id, function_cd);
1136--
1137-- NAME: FN_TAB_TAB_CD; TYPE: CONSTRAINT
1138--
1139alter table fn_tab
1140 add constraint fn_tab_tab_cd primary key (tab_cd);
1141--
1142-- NAME: FN_TAB_SELECTED_SELECTED_TAB_CDTAB_URI; TYPE: CONSTRAINT
1143--
1144alter table fn_tab_selected
1145 add constraint fn_tab_selected_selected_tab_cdtab_uri primary key (selected_tab_cd, tab_uri);
1146--
1147-- NAME: FN_USER_PSEUDO_ROLE_PSEUDO_ROLE_IDUSER_ID; TYPE: CONSTRAINT
1148--
1149alter table fn_user_pseudo_role
1150 add constraint fn_user_pseudo_role_pseudo_role_iduser_id primary key (pseudo_role_id, user_id);
1151--
1152-- NAME: FN_USER_ROLE_USER_IDROLE_ID; TYPE: CONSTRAINT
1153--
1154alter table fn_user_role
1155 add constraint fn_user_role_user_idrole_id primary key (user_id, role_id, app_id);
1156--
1157-- Name: fn_lu_message_location_MESSAGE_LOCATION_ID; Type: CONSTRAINT
1158--
1159
1160ALTER TABLE fn_lu_message_location
1161 ADD CONSTRAINT fn_lu_message_location_MESSAGE_LOCATION_ID PRIMARY KEY (message_location_id);
1162
1163-- ------------------ CREATE INDEX SECTION
1164--
1165-- NAME: CR_REPORT_CREATE_IDPUBLIC_YNTITLE; TYPE: INDEX
1166--
1167create index cr_report_create_idpublic_yntitle using btree on cr_report (create_id, public_yn, title);
1168--
1169-- NAME: CR_TABLE_JOIN_DEST_TABLE_NAME; TYPE: INDEX
1170--
1171create index cr_table_join_dest_table_name using btree on cr_table_join (dest_table_name);
1172--
1173-- NAME: CR_TABLE_JOIN_SRC_TABLE_NAME; TYPE: INDEX
1174--
1175create index cr_table_join_src_table_name using btree on cr_table_join (src_table_name);
1176--
1177-- NAME: FN_AUDIT_LOG_ACTIVITY_CD; TYPE: INDEX
1178--
1179create index fn_audit_log_activity_cd using btree on fn_audit_log (activity_cd);
1180--
1181-- NAME: FN_AUDIT_LOG_USER_ID; TYPE: INDEX
1182--
1183create index fn_audit_log_user_id using btree on fn_audit_log (user_id);
1184--
1185-- NAME: FN_MENU_FUNCTION_CD; TYPE: INDEX
1186--
1187create index fn_menu_function_cd using btree on fn_menu (function_cd);
1188--
1189-- NAME: FN_ORG_ACCESS_CD; TYPE: INDEX
1190--
1191create index fn_org_access_cd using btree on fn_org (access_cd);
1192--
1193-- NAME: FN_ROLE_FUNCTION_FUNCTION_CD; TYPE: INDEX
1194--
1195create index fn_role_function_function_cd using btree on fn_role_function (function_cd);
1196--
1197-- NAME: FN_ROLE_FUNCTION_ROLE_ID; TYPE: INDEX
1198--
1199create index fn_role_function_role_id using btree on fn_role_function (role_id);
1200--
1201-- NAME: FN_USER_ADDRESS_ID; TYPE: INDEX
1202--
1203create index fn_user_address_id using btree on fn_user (address_id);
1204--
1205-- NAME: FN_USER_ALERT_METHOD_CD; TYPE: INDEX
1206--
1207create index fn_user_alert_method_cd using btree on fn_user (alert_method_cd);
1208--
1209-- NAME: FN_USER_HRID; TYPE: INDEX
1210--
1211create unique index fn_user_hrid using btree on fn_user (hrid);
1212--
1213-- NAME: FN_USER_LOGIN_ID; TYPE: INDEX
1214--
1215create unique index fn_user_login_id using btree on fn_user (login_id);
1216--
1217-- NAME: FN_USER_ORG_ID; TYPE: INDEX
1218--
1219create index fn_user_org_id using btree on fn_user (org_id);
1220--
1221-- NAME: FN_USER_ROLE_ROLE_ID; TYPE: INDEX
1222--
1223create index fn_user_role_role_id using btree on fn_user_role (role_id);
1224--
1225-- NAME: FN_USER_ROLE_USER_ID; TYPE: INDEX
1226--
1227create index fn_user_role_user_id using btree on fn_user_role (user_id);
1228--
1229-- NAME: FK_FN_USER__REF_178_FN_APP_idx; TYPE: INDEX
1230--
1231create index fk_fn_user__ref_178_fn_app_IDX on fn_user_role (app_id);
1232
1233-- ----------------------------------------------------------
1234-- NAME: QUARTZ TYPE: INDEXES
1235-- ----------------------------------------------------------
1236create index idx_fn_qz_j_req_recovery on fn_qz_job_details(sched_name,requests_recovery);
1237create index idx_fn_qz_j_grp on fn_qz_job_details(sched_name,job_group);
1238create index idx_fn_qz_t_j on fn_qz_triggers(sched_name,job_name,job_group);
1239create index idx_fn_qz_t_jg on fn_qz_triggers(sched_name,job_group);
1240create index idx_fn_qz_t_c on fn_qz_triggers(sched_name,calendar_name);
1241create index idx_fn_qz_t_g on fn_qz_triggers(sched_name,trigger_group);
1242create index idx_fn_qz_t_state on fn_qz_triggers(sched_name,trigger_state);
1243create index idx_fn_qz_t_n_state on fn_qz_triggers(sched_name,trigger_name,trigger_group,trigger_state);
1244create index idx_fn_qz_t_n_g_state on fn_qz_triggers(sched_name,trigger_group,trigger_state);
1245create index idx_fn_qz_t_next_fire_time on fn_qz_triggers(sched_name,next_fire_time);
1246create index idx_fn_qz_t_nft_st on fn_qz_triggers(sched_name,trigger_state,next_fire_time);
1247create index idx_fn_qz_t_nft_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time);
1248create index idx_fn_qz_t_nft_st_misfire on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_state);
1249create index idx_fn_qz_t_nft_st_misfire_grp on fn_qz_triggers(sched_name,misfire_instr,next_fire_time,trigger_group,trigger_state);
1250create index idx_fn_qz_ft_trig_inst_name on fn_qz_fired_triggers(sched_name,instance_name);
1251create index idx_fn_qz_ft_inst_job_req_rcvry on fn_qz_fired_triggers(sched_name,instance_name,requests_recovery);
1252create index idx_fn_qz_ft_j_g on fn_qz_fired_triggers(sched_name,job_name,job_group);
1253create index idx_fn_qz_ft_jg on fn_qz_fired_triggers(sched_name,job_group);
1254create index idx_fn_qz_ft_t_g on fn_qz_fired_triggers(sched_name,trigger_name,trigger_group);
1255create index idx_fn_qz_ft_tg on fn_qz_fired_triggers(sched_name,trigger_group);
1256
1257-- ------------------ ALTER TABLE ADD CONSTRAINT FOREIGN KEY SECTION
1258--
1259-- NAME: FK_FN_AUDIT_REF_205_FN_LU_AC; TYPE: CONSTRAINT
1260--
1261alter table fn_audit_log
1262 add constraint fk_fn_audit_ref_205_fn_lu_ac foreign key (activity_cd) references fn_lu_activity(activity_cd);
1263--
1264-- NAME: FK_FN_ROLE__REF_201_FN_FUNCT; TYPE: CONSTRAINT
1265--
1266alter table fn_role_function
1267 add constraint fk_fn_role__ref_201_fn_funct foreign key (function_cd) references fn_function(function_cd);
1268--
1269-- NAME: FK_FN_USER__REF_178_FN_APP; TYPE: FK CONSTRAINT
1270--
1271alter table fn_user_role
1272 add constraint fk_fn_user__ref_178_fn_app foreign key (app_id) references fn_app(app_id);
1273--
1274-- NAME: FK_CR_REPOR_REF_14707_CR_REPOR; TYPE: FK CONSTRAINT
1275--
1276alter table cr_report_schedule
1277 add constraint fk_cr_repor_ref_14707_cr_repor foreign key (rep_id) references cr_report(rep_id);
1278--
1279-- NAME: FK_CR_REPOR_REF_14716_CR_REPOR; TYPE: FK CONSTRAINT
1280--
1281alter table cr_report_schedule_users
1282 add constraint fk_cr_repor_ref_14716_cr_repor foreign key (schedule_id) references cr_report_schedule(schedule_id);
1283--
1284-- NAME: FK_CR_REPOR_REF_17645_CR_REPOR; TYPE: FK CONSTRAINT
1285--
1286alter table cr_report_log
1287 add constraint fk_cr_repor_ref_17645_cr_repor foreign key (rep_id) references cr_report(rep_id);
1288--
1289-- NAME: FK_CR_REPOR_REF_8550_CR_REPOR; TYPE: FK CONSTRAINT
1290--
1291alter table cr_report_access
1292 add constraint fk_cr_repor_ref_8550_cr_repor foreign key (rep_id) references cr_report(rep_id);
1293--
1294-- NAME: FK_CR_REPORT_REP_ID; TYPE: FK CONSTRAINT
1295--
1296alter table cr_report_email_sent_log
1297 add constraint fk_cr_report_rep_id foreign key (rep_id) references cr_report(rep_id);
1298--
1299-- NAME: FK_CR_TABLE_REF_311_CR_TAB; TYPE: FK CONSTRAINT
1300--
1301alter table cr_table_join
1302 add constraint fk_cr_table_ref_311_cr_tab foreign key (src_table_name) references cr_table_source(table_name);
1303--
1304-- NAME: FK_CR_TABLE_REF_315_CR_TAB; TYPE: FK CONSTRAINT
1305--
1306alter table cr_table_join
1307 add constraint fk_cr_table_ref_315_cr_tab foreign key (dest_table_name) references cr_table_source(table_name);
1308--
1309-- NAME: FK_CR_TABLE_REF_32384_CR_TABLE; TYPE: FK CONSTRAINT
1310--
1311alter table cr_table_role
1312 add constraint fk_cr_table_ref_32384_cr_table foreign key (table_name) references cr_table_source(table_name);
1313--
1314-- NAME: FK_FN_TAB_FUNCTION_CD; TYPE: FK CONSTRAINT
1315--
1316alter table fn_tab
1317 add constraint fk_fn_tab_function_cd foreign key (function_cd) references fn_function(function_cd);
1318--
1319-- NAME: FK_FN_TAB_SELECTED_TAB_CD; TYPE: FK CONSTRAINT
1320--
1321alter table fn_tab_selected
1322 add constraint fk_fn_tab_selected_tab_cd foreign key (selected_tab_cd) references fn_tab(tab_cd);
1323--
1324-- NAME: FK_FN_TAB_SET_CD; TYPE: FK CONSTRAINT
1325--
1326alter table fn_tab
1327 add constraint fk_fn_tab_set_cd foreign key (tab_set_cd) references fn_lu_tab_set(tab_set_cd);
1328--
1329-- NAME: FK_FN_USER_REF_110_FN_ORG; TYPE: FK CONSTRAINT
1330--
1331alter table fn_user
1332 add constraint fk_fn_user_ref_110_fn_org foreign key (org_id) references fn_org(org_id);
1333--
1334-- NAME: FK_FN_USER_REF_123_FN_LU_AL; TYPE: FK CONSTRAINT
1335--
1336alter table fn_user
1337 add constraint fk_fn_user_ref_123_fn_lu_al foreign key (alert_method_cd) references fn_lu_alert_method(alert_method_cd);
1338--
1339-- NAME: FK_FN_USER_REF_197_FN_USER; TYPE: FK CONSTRAINT
1340--
1341alter table fn_user
1342 add constraint fk_fn_user_ref_197_fn_user foreign key (manager_id) references fn_user(user_id);
1343--
1344-- NAME: FK_FN_USER_REF_198_FN_USER; TYPE: FK CONSTRAINT
1345--
1346alter table fn_user
1347 add constraint fk_fn_user_ref_198_fn_user foreign key (created_id) references fn_user(user_id);
1348--
1349-- NAME: FK_FN_USER_REF_199_FN_USER; TYPE: FK CONSTRAINT
1350--
1351alter table fn_user
1352 add constraint fk_fn_user_ref_199_fn_user foreign key (modified_id) references fn_user(user_id);
1353--
1354-- NAME: FK_PARENT_KEY_CR_FOLDER; TYPE: FK CONSTRAINT
1355--
1356alter table cr_folder
1357 add constraint fk_parent_key_cr_folder foreign key (parent_folder_id) references cr_folder(folder_id);
1358--
1359-- NAME: FK_PSEUDO_ROLE_PSEUDO_ROLE_ID; TYPE: FK CONSTRAINT
1360--
1361alter table fn_user_pseudo_role
1362 add constraint fk_pseudo_role_pseudo_role_id foreign key (pseudo_role_id) references fn_role(role_id);
1363--
1364-- NAME: FK_PSEUDO_ROLE_USER_ID; TYPE: FK CONSTRAINT
1365--
1366alter table fn_user_pseudo_role
1367 add constraint fk_pseudo_role_user_id foreign key (user_id) references fn_user(user_id);
1368--
1369-- NAME: FK_RESTRICTED_URL_FUNCTION_CD; TYPE: FK CONSTRAINT
1370--
1371alter table fn_restricted_url
1372 add constraint fk_restricted_url_function_cd foreign key (function_cd) references fn_function(function_cd);
1373--
1374-- NAME: FK_TIMEZONE; TYPE: FK CONSTRAINT
1375--
1376alter table fn_user
1377 add constraint fk_timezone foreign key (timezone) references fn_lu_timezone(timezone_id);
1378--
1379-- NAME: SYS_C0014614; TYPE: FK CONSTRAINT
1380--
1381alter table cr_report_file_history
1382 add constraint sys_c0014614 foreign key (file_type_id) references cr_lu_file_type(lookup_id);
1383--
1384-- NAME: SYS_C0014615; TYPE: FK CONSTRAINT
1385--
1386alter table cr_report_file_history
1387 add constraint sys_c0014615 foreign key (rep_id) references cr_report(rep_id);
1388--
1389-- NAME: SYS_C0014616; TYPE: FK CONSTRAINT
1390--
1391alter table cr_hist_user_map
1392 add constraint sys_c0014616 foreign key (hist_id) references cr_report_file_history(hist_id);
1393--
1394-- NAME: SYS_C0014617; TYPE: FK CONSTRAINT
1395--
1396alter table cr_hist_user_map
1397 add constraint sys_c0014617 foreign key (user_id) references fn_user(user_id);
1398
1399commit;