forked from svn2github/SpagoBI-V4x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hystory_mysql.txt
2673 lines (2202 loc) · 134 KB
/
hystory_mysql.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Insert in this file the history of DB Schema, only for MySQL
Every items must have:
- The Developer who has made the change
- The SQL script that updates the schema ( schema, index and FK )
- The Date
###################################################################################################
- DBMS changes After 2.0
- Angelo
- 27/02/2009
ALTER TABLE `spagobi`.`sbi_audit` MODIFY COLUMN `DOC_PARAMETERS` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;
ALTER TABLE `spagobi`.`sbi_viewpoints` MODIFY COLUMN `VP_VALUE_PARAMS` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;
ALTER TABLE `spagobi`.`sbi_remember_me` MODIFY COLUMN `PARAMETERS` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;
ALTER TABLE `spagobi`.`sbi_data_set` MODIFY COLUMN `NUM_ROWS` BOOLEAN DEFAULT FALSE;
ALTER TABLE `spagobi`.`sbi_menu` MODIFY COLUMN `BIOBJ_PARAMETERS` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER TABLE `spagobi`.`sbi_kpi` ADD COLUMN `kpi_type` INTEGER AFTER `flg_is_father`,
ADD COLUMN `metric_scale_type` INTEGER AFTER `kpi_type`,
ADD COLUMN `measure_type` INTEGER AFTER `metric_scale_type`,
ADD COLUMN `interpretation` VARCHAR(1000) AFTER `measure_type`,
ADD COLUMN `input_attributes` VARCHAR(1000) AFTER `interpretation`,
ADD COLUMN `model_reference` VARCHAR(255) AFTER `input_attributes`,
ADD COLUMN `target_audience` VARCHAR(1000) AFTER `model_reference`;
ALTER TABLE `spagobi`.`sbi_kpi_inst_period` CHANGE COLUMN `DEFAULT` `DEFAULT_VALUE` BOOLEAN DEFAULT NULL;
ALTER TABLE `spagobi`.`sbi_kpi_model_inst` ADD COLUMN `label` VARCHAR(100) BINARY NOT NULL AFTER `description`,
ADD COLUMN `start_date` DATETIME AFTER `label`,
ADD COLUMN `end_date` DATETIME AFTER `start_date`;
ALTER TABLE `spagobi`.`sbi_alarm_event` ADD COLUMN `KPI_DESCRIPTION` VARCHAR(100) AFTER `RESOURCES`,
ADD COLUMN `RESOURCE_ID` INTEGER UNSIGNED AFTER `KPI_DESCRIPTION`,
ADD COLUMN `KPI_INSTANCE_ID` INTEGER UNSIGNED AFTER `RESOURCE_ID`;
CREATE UNIQUE INDEX XAK2SBI_KPI_MODEL_INST ON SBI_KPI_MODEL_INST
(
LABEL ASC
);
Alter table `SBI_KPI_INSTANCE` add Foreign Key (`KPI_ID`) references `SBI_KPI` (`KPI_ID`) on delete restrict on update restrict;
Alter table `SBI_KPI` add Foreign Key (`kpi_type`) references `SBI_DOMAINS` (`VALUE_ID`) on delete restrict on update restrict;
Alter table `SBI_KPI` add Foreign Key (`metric_scale_type`) references `SBI_DOMAINS` (`VALUE_ID`) on delete restrict on update restrict;
Alter table `SBI_KPI` add Foreign Key (`measure_type`) references `SBI_DOMAINS` (`VALUE_ID`) on delete restrict on update restrict;
ALTER TABLE `spagobi`.`sbi_data_set` ADD COLUMN `LANGUAGE_SCRIPT` VARCHAR(50) AFTER `num_rows`;
- gigavard
- 12/03/2009
ALTER TABLE `spagobi`.`sbi_domains` MODIFY COLUMN `VALUE_CD` VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
- gigavard
- 13/03/2009
ALTER TABLE `spagobi`.`sbi_functions` MODIFY COLUMN `CODE` VARCHAR(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
###################################################################################################
- DBMS changes After 2.1
- gigavard
- 20/04/2009
ALTER TABLE SBI_DATA_SOURCE MODIFY COLUMN `URL_CONNECTION` VARCHAR(500) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;
- gigavard
- 29/04/2009
ALTER TABLE `spagobi`.`SBI_ALARM` ADD UNIQUE INDEX `label_unique`(`LABEL`);
ALTER TABLE `spagobi`.`SBI_ALARM_CONTACT` ADD UNIQUE INDEX `name_unique`(`NAME`);
ALTER TABLE `spagobi`.`SBI_KPI` ADD UNIQUE INDEX `code_unique`(`code`);
ALTER TABLE `spagobi`.`SBI_KPI_MODEL` ADD UNIQUE INDEX `unique_kpi_model_cd`(`KPI_MODEL_CD`);
ALTER TABLE `spagobi`.`SBI_KPI_PERIODICITY` ADD UNIQUE INDEX `name_unique`(`name`);
ALTER TABLE `spagobi`.`SBI_THRESHOLD` ADD UNIQUE INDEX `code_unique`(`code`);
ALTER TABLE `spagobi`.`SBI_THRESHOLD_VALUE` ADD UNIQUE INDEX `label_thId_unique`(`label`, `THRESHOLD_ID`);
ALTER TABLE `spagobi`.`SBI_RESOURCES` ADD UNIQUE INDEX `unique_resource_name`(`RESOURCE_NAME`);
ALTER TABLE `spagobi`.`SBI_KPI_MODEL` MODIFY COLUMN `KPI_MODEL_CD` VARCHAR(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `spagobi`.`SBI_ALARM` MODIFY COLUMN `LABEL` VARCHAR(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `spagobi`.`SBI_KPI_PERIODICITY` MODIFY COLUMN `name` VARCHAR(400) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `spagobi`.`SBI_RESOURCES` MODIFY COLUMN `RESOURCE_NAME` VARCHAR(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `spagobi`.`SBI_THRESHOLD` MODIFY COLUMN `code` VARCHAR(45) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
ALTER TABLE `spagobi`.`SBI_THRESHOLD_VALUE` MODIFY COLUMN `label` VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
- gigavard
- 15/06/2009
CREATE TABLE SBI_EXPORTERS (
ENGINE_ID INTEGER NOT NULL,
DOMAIN_ID INTEGER NOT NULL,
DEFAULT_VALUE BOOLEAN,
PRIMARY KEY (ENGINE_ID, DOMAIN_ID)) type = InnoDB;
CREATE UNIQUE INDEX XAK1SBI_EXPORTERS ON SBI_EXPORTERS
(
ENGINE_ID ASC,
DOMAIN_ID ASC
);
ALTER TABLE SBI_EXPORTERS ADD CONSTRAINT FK_sbi_exporters_domain FOREIGN KEY FK_sbi_exporters_domain ( DOMAIN_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE RESTRICT;
ALTER TABLE SBI_EXPORTERS ADD CONSTRAINT FK_sbi_exporters_engine FOREIGN KEY FK_sbi_exporters_engine ( ENGINE_ID ) REFERENCES SBI_ENGINES ( ENGINE_ID ) ON DELETE RESTRICT;
###################################################################################################
- DBMS changes After 2.2
- angelo
-31/07/09
ALTER TABLE SBI_DATA_SOURCE ADD COLUMN MULTI_SCHEMA TINYINT(1) NOT NULL DEFAULT '0';
ALTER TABLE SBI_DATA_SOURCE ADD COLUMN ATTR_SCHEMA VARCHAR(45) DEFAULT NULL;
- davide
-07/09/09
ALTER TABLE SBI_EXT_ROLES ADD COLUMN BUILD_QBE_QUERY BOOLEAN DEFAULT TRUE;
-chiara
-09/09/2009
ALTER TABLE SBI_KPI_VALUE ADD COLUMN XML_DATA TEXT;
###################################################################################################
- DBMS changes After 2.3
-giulio
-05/11/2009
ALTER TABLE SBI_DATA_SET ADD COLUMN DS_METADATA VARCHAR(2000) DEFAULT NULL;
-antonella
-12/11/2009
ALTER TABLE SBI_OBJECT_NOTES ADD COLUMN OWNER VARCHAR(50);
ALTER TABLE SBI_OBJECT_NOTES ADD COLUMN ISPUBLIC BOOLEAN;
ALTER TABLE SBI_OBJECT_NOTES ADD COLUMN CREATION_DATE TIMESTAMP NOT NULL;
ALTER TABLE SBI_OBJECT_NOTES ADD COLUMN LAST_CHANGE_DATE TIMESTAMP NOT NULL;
/* force a valid value for date fields in existing records: */
UPDATE SBI_OBJECT_NOTES SET LAST_CHANGE_DATE = NOW(),CREATION_DATE = NOW();
/* force a valid value for owner field in existing records:
***************************** ATTENTION **********************************
* The OWNER value depends from your context...
we suggest 'biadmin' because is the classic admin user in SpaogoBI demo:
you should change this value with a valid user in your platfrom, in this way
he may change or delete the EXISTING notes!!*/
UPDATE SBI_OBJECT_NOTES SET OWNER = 'biadmin';
/*************************************************************************/
COMMIT;
-19/11/2009
DELETE FROM SBI_REMEMBER_ME WHERE SUBOBJ_ID IN (SELECT SUBOBJ_ID FROM SBI_SUBOBJECTS WHERE NAME IS NULL OR NAME ='');
DELETE FROM SBI_AUDIT WHERE SUBOBJ_ID IN (SELECT SUBOBJ_ID FROM SBI_SUBOBJECTS WHERE NAME IS NULL OR NAME ='');
DELETE FROM SBI_MENU WHERE SUBOBJ_NAME IN (SELECT NAME FROM SBI_SUBOBJECTS WHERE NAME IS NULL OR NAME ='');
DELETE FROM SBI_BINARY_CONTENTS WHERE BIN_ID IN (SELECT BIN_ID FROM SBI_SUBOBJECTS WHERE NAME IS NULL OR NAME ='');
DELETE FROM SBI_SUBOBJECTS WHERE NAME IS NULL OR NAME ='';
COMMIT;
ALTER TABLE SBI_SUBOBJECTS MODIFY COLUMN NAME VARCHAR(50) NOT NULL;
-24/11/2009
ALTER TABLE SBI_OBJECTS DROP COLUMN DESCR_EXT;
ALTER TABLE SBI_OBJECTS DROP COLUMN OBJECTIVE;
ALTER TABLE SBI_OBJECTS DROP COLUMN LANGUAGE;
ALTER TABLE SBI_OBJECTS DROP COLUMN KEYWORDS;
ALTER TABLE SBI_EXT_ROLES ADD COLUMN SAVE_METADATA BOOLEAN DEFAULT TRUE;
CREATE TABLE SBI_OBJ_METADATA (
OBJ_META_ID INTEGER NOT NULL AUTO_INCREMENT,
LABEL VARCHAR(20) NOT NULL,
NAME VARCHAR(40) NOT NULL,
DESCRIPTION VARCHAR(100),
DATA_TYPE_ID INTEGER NOT NULL,
CREATION_DATE TIMESTAMP NOT NULL,
PRIMARY KEY (OBJ_META_ID)
)TYPE=INNODB;
CREATE UNIQUE INDEX XAK1SBI_OBJ_METADATA ON SBI_OBJ_METADATA
(
OBJ_META_ID ASC
);
ALTER TABLE SBI_OBJ_METADATA ADD CONSTRAINT FK_SBI_OBJ_METADATA_1 FOREIGN KEY FK_SBI_OBJ_METADATA_1 ( DATA_TYPE_ID ) REFERENCES SBI_DOMAINS(VALUE_ID);
CREATE TABLE SBI_OBJ_METACONTENTS (
OBJ_METACONTENT_ID INTEGER NOT NULL AUTO_INCREMENT,
OBJMETA_ID INTEGER NOT NULL ,
BIOBJ_ID INTEGER NOT NULL,
SUBOBJ_ID INTEGER,
BIN_ID INTEGER,
CREATION_DATE TIMESTAMP NOT NULL,
LAST_CHANGE_DATE TIMESTAMP NOT NULL,
PRIMARY KEY (OBJ_METACONTENT_ID)
)ENGINE=INNODB;
CREATE UNIQUE INDEX XAK1SBI_OBJ_METACONTENTS ON SBI_OBJ_METACONTENTS
(
OBJMETA_ID ASC,
BIOBJ_ID ASC,
SUBOBJ_ID ASC
);
ALTER TABLE SBI_OBJ_METACONTENTS ADD CONSTRAINT FK_SBI_OBJ_METACONTENTS_1 FOREIGN KEY FK_SBI_OBJ_METACONTENTS_1 ( OBJMETA_ID ) REFERENCES SBI_OBJ_METADATA ( OBJ_META_ID );
ALTER TABLE SBI_OBJ_METACONTENTS ADD CONSTRAINT FK_SBI_OBJ_METACONTENTS_2 FOREIGN KEY FK_SBI_OBJ_METACONTENTS_2 ( BIOBJ_ID ) REFERENCES SBI_OBJECTS ( BIOBJ_ID );
ALTER TABLE SBI_OBJ_METACONTENTS ADD CONSTRAINT FK_SBI_OBJ_METACONTENTS_3 FOREIGN KEY FK_SBI_OBJ_METACONTENTS_3 ( SUBOBJ_ID ) REFERENCES SBI_SUBOBJECTS ( SUBOBJ_ID ) ;
ALTER TABLE SBI_OBJ_METACONTENTS ADD CONSTRAINT FK_SBI_OBJ_METACONTENTS_4 FOREIGN KEY FK_SBI_OBJ_METACONTENTS_4 ( BIN_ID ) REFERENCES SBI_BINARY_CONTENTS(BIN_ID);
--adds new funcionality for metadata management
INSERT INTO SBI_USER_FUNC (NAME, DESCRIPTION) VALUES ('ObjMetadataManagement', 'ObjMetadataManagement');
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'ADMIN'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='ObjMetadataManagement'))
COMMIT;
-chiara
ALTER TABLE SBI_SUBOBJECTS MODIFY COLUMN DESCRIPTION VARCHAR(1000) DEFAULT NULL;
- DBMS changes After 2.4
-- Nicola 21/12/2009
/* Modifies to add Model Label */
ALTER TABLE SBI_KPI_MODEL ADD COLUMN KPI_MODEL_LBL VARCHAR(100) NOT NULL AFTER KPI_MODEL_DESC;
UPDATE SBI_KPI_MODEL SET KPI_MODEL_LBL = KPI_MODEL_CD;
ALTER TABLE SBI_KPI_MODEL DROP INDEX KPI_MODEL_CD;
ALTER TABLE SBI_KPI_MODEL ADD UNIQUE INDEX UNIQUE_LABEL(KPI_MODEL_LBL);
ALTER TABLE SBI_KPI_MODEL ADD UNIQUE INDEX UNIQUE_PAR_ID_CD(KPI_PARENT_MODEL_ID, KPI_MODEL_CD);
/* Modifies SBI_THRESHOLD_VALUE TABLE to add the selection to specify if the range is open or closed */
ALTER TABLE SBI_THRESHOLD_VALUE ADD COLUMN min_closed BOOLEAN ,
ADD COLUMN max_closed BOOLEAN ,
ADD COLUMN th_value DOUBLE ;
/* Modifies SBI_KPI_MODEL_INST to specify a KPI INSTANCE or a MODEL INSTANCE LABEL */
ALTER TABLE SBI_KPI_MODEL_INST ADD COLUMN modelUUID VARCHAR(400);
-- Giulio 4/1/2010
ALTER TABLE sbi_lov MODIFY COLUMN LOV_PROVIDER VARCHAR TEXT DEFAULT NULL;
--Monica 11/01/2010
CREATE TABLE SBI_USER (
USER_ID CHAR(100) NOT NULL,
PASSWORD VARCHAR(150),
FULL_NAME VARCHAR(255),
DT_PWD_BEGIN DATETIME,
DT_PWD_END DATETIME,
FLG_PWD_BLOCKED BOOLEAN,
DT_LAST_ACCESS DATETIME,
ID INT NOT NULL,
PRIMARY KEY (ID));
CREATE TABLE SBI_ATTRIBUTE (
ATTRIBUTE_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(500) NOT NULL,
ATTRIBUTE_ID INT NOT NULL,
PRIMARY KEY (ATTRIBUTE_ID));
CREATE TABLE SBI_USER_ATTRIBUTES (
ID INT NOT NULL,
ATTRIBUTE_ID INT NOT NULL,
ATTRIBUTE_VALUE VARCHAR(500),
PRIMARY KEY (ID,ATTRIBUTE_ID));
CREATE TABLE SBI_EXT_USER_ROLES (
ID INT NOT NULL,
EXT_ROLE_ID INT NOT NULL,
PRIMARY KEY (ID,EXT_ROLE_ID));
ALTER TABLE SBI_USER_ATTRIBUTES ADD FOREIGN KEY (ID) REFERENCES SBI_USER (ID) ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE SBI_EXT_USER_ROLES ADD FOREIGN KEY (ID) REFERENCES SBI_USER (ID) ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE SBI_USER_ATTRIBUTES ADD FOREIGN KEY (ATTRIBUTE_ID) REFERENCES SBI_ATTRIBUTE (ATTRIBUTE_ID) ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE SBI_EXT_USER_ROLES ADD FOREIGN KEY (EXT_ROLE_ID) REFERENCES SBI_EXT_ROLES (EXT_ROLE_ID) ON DELETE RESTRICT ON UPDATE RESTRICT;
--Antonella 20/01/2010
/** configuration table*/
CREATE TABLE SBI_CONFIG (
ID INTEGER NOT NULL AUTO_INCREMENT,
LABEL VARCHAR(100) NOT NULL,
NAME VARCHAR(100) NULL,
DESCRIPTION VARCHAR(500) NULL,
IS_ACTIVE BOOLEAN DEFAULT TRUE,
VALUE_CHECK VARCHAR(1000) NULL,
VALUE_TYPE_ID INTEGER NULL,
PRIMARY KEY (ID));
CREATE UNIQUE INDEX XAK1SBI_CONFIG ON SBI_CONFIG
(
LABEL ASC
);
ALTER TABLE SBI_CONFIG ADD CONSTRAINT FK_sbi_config_1 FOREIGN KEY FK_sbi_config_1 ( VALUE_TYPE_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE RESTRICT;
--Antonella 27/01/2010
/** change creation date datatype (date --> timestamp) */
ALTER TABLE SBI_VIEWPOINTS MODIFY COLUMN VP_CREATION_DATE TIMESTAMP NOT NULL;
--Chiara 03/02/2010
CREATE TABLE SBI_ACTIVITY_MONITORING (
ID INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
ACTION_TIME TIMESTAMP,
USERNAME VARCHAR(40) NOT NULL,
USERGROUP VARCHAR(400),
LOG_LEVEL VARCHAR(10) ,
ACTION_CODE VARCHAR(45) NOT NULL,
INFO VARCHAR(400),
PRIMARY KEY (ID)
)ENGINE=INNODB;
CREATE UNIQUE INDEX XAK1SBI_USER ON SBI_USER
(
USER_ID ASC
);
ALTER TABLE SBI_ALARM MODIFY COLUMN ID_KPI_INSTANCE INTEGER,
MODIFY COLUMN ID_THRESHOLD_VALUE INTEGER;
-- ##################################################################################################
-- From 2.5
-- ##################################################################################################
--Chiara 27/05/2010
ALTER TABLE SBI_RESOURCES ADD COLUMN RESOURCE_CODE VARCHAR(45);
UPDATE SBI_RESOURCES SET RESOURCE_CODE = RESOURCE_NAME;
ALTER TABLE SBI_RESOURCES ADD UNIQUE INDEX UNIQUE_RES_CODE (RESOURCE_CODE);
ALTER TABLE SBI_RESOURCES MODIFY COLUMN RESOURCE_CODE VARCHAR(45) NOT NULL;
--Chiara 28/08/2010
Create table `SBI_KPI_DOCUMENTS` (
`ID_KPI_DOC` Int NOT NULL AUTO_INCREMENT,
`BIOBJ_ID` Int NOT NULL,
`KPI_ID` Int NOT NULL,
Primary Key (`ID_KPI_DOC`)) ENGINE = InnoDB;
Alter table `SBI_KPI_DOCUMENTS` add Foreign Key (`BIOBJ_ID`) references `SBI_OBJECTS` (`BIOBJ_ID`) on delete restrict on update restrict;
Alter table `SBI_KPI_DOCUMENTS` add Foreign Key (`KPI_ID`) references `SBI_KPI` (`KPI_ID`) on delete restrict on update restrict;
INSERT INTO SBI_KPI_DOCUMENTS(KPI_ID,BIOBJ_ID)
SELECT k.KPI_ID, o.BIOBJ_ID
FROM sbi_kpi k,sbi_Objects o
WHERE
k.DOCUMENT_LABEL = o.LABEL
and k.DOCUMENT_LABEL IS NOT NULL;
ALTER TABLE SBI_KPI DROP COLUMN document_label;
--Antonella 08/09/2010: generic user defined property management
CREATE TABLE SBI_UDP (
UDP_ID INTEGER NOT NULL AUTO_INCREMENT,
TYPE_ID INTEGER NOT NULL,
FAMILY_ID INTEGER NOT NULL,
LABEL VARCHAR(20) NOT NULL,
NAME VARCHAR(40) NOT NULL,
DESCRIPTION VARCHAR(1000) NULL,
IS_MULTIVALUE BOOLEAN DEFAULT FALSE,
PRIMARY KEY (UDP_ID));
CREATE UNIQUE INDEX XAK1SBI_UDP ON SBI_UDP
(
LABEL ASC
);
CREATE INDEX XIF3_SBI_SBI_UDP ON SBI_UDP
(
TYPE_ID ASC
);
CREATE INDEX XIF2SBI_SBI_UDP ON SBI_UDP
(
FAMILY_ID ASC
);
ALTER TABLE SBI_UDP ADD CONSTRAINT FK_SBI_SBI_UDP_1 FOREIGN KEY FK_SBI_UDP_1 ( TYPE_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE RESTRICT;
ALTER TABLE SBI_UDP ADD CONSTRAINT FK_SBI_SBI_UDP_2 FOREIGN KEY FK_SBI_UDP_2 ( FAMILY_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE RESTRICT;
CREATE TABLE SBI_UDP_VALUE (
UDP_VALUE_ID INTEGER NOT NULL AUTO_INCREMENT,
UDP_ID INTEGER NOT NULL,
VALUE VARCHAR(1000) NOT NULL,
PROG INTEGER NULL,
LABEL VARCHAR(20) NOT NULL,
NAME VARCHAR(40) NULL,
FAMILY VARCHAR(40) NULL,
BEGIN_TS TIMESTAMP NOT NULL,
END_TS TIMESTAMP NULL,
REFERENCE_ID INTEGER NULL,
PRIMARY KEY (UDP_VALUE_ID));
CREATE INDEX XIF2SBI_SBI_UDP_VALUE ON SBI_UDP_VALUE
(
UDP_ID ASC
);
ALTER TABLE SBI_UDP_VALUE ADD CONSTRAINT FK_SBI_UDP_VALUE_2 FOREIGN KEY FK_SBI_UDP_VALUE_2 ( UDP_ID ) REFERENCES SBI_UDP ( UDP_ID ) ON DELETE RESTRICT;
--adds new funcionality for udp management
INSERT INTO SBI_USER_FUNC (NAME, DESCRIPTION) VALUES ('UserDefinedPropertyManagement', 'UserDefinedPropertyManagement');
COMMIT;
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'ADMIN'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='UserDefinedPropertyManagement'))
COMMIT;
--Monica : KPI RELATIONS
CREATE TABLE SBI_KPI_REL (
KPI_REL_ID INT(11) NOT NULL AUTO_INCREMENT,
KPI_FATHER_ID INT(11) NOT NULL,
KPI_CHILD_ID INT(11) NOT NULL,
PARAMETER VARCHAR(100),
PRIMARY KEY (KPI_REL_ID)
)ENGINE=INNODB;
ALTER TABLE SBI_KPI_REL ADD CONSTRAINT FK_SBI_KPI_REL_3 FOREIGN KEY FK_SBI_KPI_REL_3 ( KPI_FATHER_ID ) REFERENCES SBI_KPI ( KPI_ID ) ON DELETE RESTRICT;
ALTER TABLE SBI_KPI_REL ADD CONSTRAINT FK_SBI_KPI_REL_4 FOREIGN KEY FK_SBI_KPI_REL_4 ( KPI_CHILD_ID ) REFERENCES SBI_KPI ( KPI_ID ) ON DELETE RESTRICT;
-- ggavardi 28/09/2010
CREATE TABLE SBI_KPI_ERROR (
KPI_ERROR_ID INTEGER NOT NULL AUTO_INCREMENT,
KPI_MODEL_INST_ID INTEGER NOT NULL,
USER_MSG VARCHAR(1000),
FULL_MSG TEXT,
TS_DATE TIMESTAMP ,
LABEL_MOD_INST VARCHAR(100) ,
PARAMETERS VARCHAR(1000),
PRIMARY KEY (KPI_ERROR_ID)
);
ALTER TABLE SBI_KPI_ERROR ADD CONSTRAINT FK_SBI_KPI_ERROR_MODEL_1 FOREIGN KEY FK_SBI_KPI_ERROR_MODEL_1 ( KPI_MODEL_INST_ID ) REFERENCES SBI_KPI_MODEL_INST ( KPI_MODEL_INST ) ON DELETE RESTRICT;
--Chiara 28/09/2010
DROP TABLE SBI_KPI_MODEL_ATTR_VAL;
DROP TABLE SBI_KPI_MODEL_ATTR;
--new column on SBI_KPI
ALTER TABLE SBI_KPI ADD COLUMN IS_ADDITIVE CHAR(1);
--Davide 29/09/2010 (Organizationl Unit)
CREATE TABLE SBI_ORG_UNIT (
ID INTEGER NOT NULL,
LABEL VARCHAR(200) NOT NULL,
NAME VARCHAR(400) NOT NULL,
DESCRIPTION VARCHAR(1000),
UNIQUE (LABEL),
PRIMARY KEY(ID)
)ENGINE=INNODB;
CREATE TABLE SBI_ORG_UNIT_HIERARCHIES (
ID INTEGER NOT NULL,
LABEL VARCHAR(100) NOT NULL,
NAME VARCHAR(200) NOT NULL,
DESCRIPTION VARCHAR(1000),
TARGET VARCHAR(1000),
COMPANY VARCHAR(100) NOT NULL,
UNIQUE (LABEL, COMPANY),
PRIMARY KEY(ID)
)ENGINE=INNODB;
CREATE TABLE SBI_ORG_UNIT_NODES (
NODE_ID INTEGER NOT NULL,
OU_ID INTEGER NOT NULL,
HIERARCHY_ID INTEGER NOT NULL,
PARENT_NODE_ID INTEGER NULL,
PATH VARCHAR(4000) NOT NULL,
PRIMARY KEY(NODE_ID)
)ENGINE=INNODB;
CREATE TABLE SBI_ORG_UNIT_GRANT (
ID INTEGER NOT NULL,
HIERARCHY_ID INTEGER NOT NULL,
KPI_MODEL_INST_NODE_ID INTEGER NOT NULL,
START_DATE DATE,
END_DATE DATE,
LABEL VARCHAR(200) NOT NULL,
NAME VARCHAR(400) NOT NULL,
DESCRIPTION VARCHAR(1000),
UNIQUE (LABEL),
PRIMARY KEY(ID)
)ENGINE=INNODB;
CREATE TABLE SBI_ORG_UNIT_GRANT_NODES (
NODE_ID INTEGER NOT NULL,
KPI_MODEL_INST_NODE_ID INTEGER NOT NULL,
GRANT_ID INTEGER NOT NULL,
PRIMARY KEY(NODE_ID, KPI_MODEL_INST_NODE_ID, GRANT_ID)
)ENGINE=INNODB;
ALTER TABLE SBI_ORG_UNIT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_NODES_1 FOREIGN KEY FK_SBI_ORG_UNIT_NODES_1 ( OU_ID ) REFERENCES SBI_ORG_UNIT ( ID ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_NODES_2 FOREIGN KEY FK_SBI_ORG_UNIT_NODES_2 ( HIERARCHY_ID ) REFERENCES SBI_ORG_UNIT_HIERARCHIES ( ID ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_NODES_3 FOREIGN KEY FK_SBI_ORG_UNIT_NODES_3 ( PARENT_NODE_ID ) REFERENCES SBI_ORG_UNIT_NODES ( NODE_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_GRANT ADD CONSTRAINT FK_SBI_ORG_UNIT_GRANT_2 FOREIGN KEY FK_SBI_ORG_UNIT_GRANT_2 ( HIERARCHY_ID ) REFERENCES SBI_ORG_UNIT_HIERARCHIES ( ID ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_GRANT ADD CONSTRAINT FK_SBI_ORG_UNIT_GRANT_3 FOREIGN KEY FK_SBI_ORG_UNIT_GRANT_3 ( KPI_MODEL_INST_NODE_ID ) REFERENCES SBI_KPI_MODEL_INST ( KPI_MODEL_INST ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_GRANT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_GRANT_NODES_1 FOREIGN KEY FK_SBI_ORG_UNIT_GRANT_NODES_1 ( NODE_ID ) REFERENCES SBI_ORG_UNIT_NODES ( NODE_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_GRANT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_GRANT_NODES_2 FOREIGN KEY FK_SBI_ORG_UNIT_GRANT_NODES_2 ( KPI_MODEL_INST_NODE_ID ) REFERENCES SBI_KPI_MODEL_INST ( KPI_MODEL_INST ) ON DELETE CASCADE;
ALTER TABLE SBI_ORG_UNIT_GRANT_NODES ADD CONSTRAINT FK_SBI_ORG_UNIT_GRANT_NODES_3 FOREIGN KEY FK_SBI_ORG_UNIT_GRANT_NODES_3 ( GRANT_ID ) REFERENCES SBI_ORG_UNIT_GRANT ( ID ) ON DELETE CASCADE;
--MONICA 18/10/10: KPI OU
ALTER TABLE SBI_KPI_VALUE ADD COLUMN ORG_UNIT_ID INTEGER;
--Davide 12/10/2010: analytical drivers are visible by default
UPDATE SBI_OBJ_PAR SET VIEW_FL = 1;
--Davide 05/11/2010: added COMPANY column to SBI_ORG_UNIT_HIERARCHIES
ALTER TABLE SBI_ORG_UNIT_HIERARCHIES ADD COLUMN COMPANY VARCHAR(200);
--MONICA 05/11/2010:BUG ON DUPLICATE ROLE NAMES
ALTER TABLE SBI_EXT_ROLES MODIFY COLUMN NAME VARCHAR(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
ADD UNIQUE INDEX NAME(NAME);
--MONICA 05/11/2010: KPI ENGINE : added hierarchy as parameter to filter grants and added company
ALTER TABLE SBI_KPI_VALUE ADD COLUMN HIERARCHY_ID INT(11) AFTER `ORG_UNIT_ID`,
ADD COLUMN `COMPANY` VARCHAR(200) AFTER `HIERARCHY_ID`;
--Davide 11/11/2010 (Organizationl Unit: colums LABEL and NAME resized to 100; unique key is (LABEL,NAME))
ALTER TABLE SBI_ORG_UNIT MODIFY COLUMN LABEL VARCHAR(100) NOT NULL;
ALTER TABLE SBI_ORG_UNIT MODIFY COLUMN NAME VARCHAR(100) NOT NULL;
ALTER TABLE SBI_ORG_UNIT DROP INDEX LABEL;
ALTER TABLE SBI_ORG_UNIT ADD INDEX XAK1SBI_ORG_UNIT(LABEL, NAME);
--Davide 16/11/2010: added url to external application in menu configuration
ALTER TABLE SBI_MENU ADD COLUMN EXT_APP_URL VARCHAR(1000);
--Andrea 20/12/2010: added to solve bug SPAGOBI-433
ALTER TABLE SBI_EVENTS_LOG MODIFY COLUMN DESCR TEXT;
COMMIT;
--Monica 10/01/2011: error in OU name filed too short
alter table sbi_org_unit modify column NAME varchar(200);
--Alberto 11/01/2011: goal scripts
CREATE TABLE SBI_GOAL (
GOAL_ID INTEGER NOT NULL AUTO_INCREMENT,
GRANT_ID INTEGER NOT NULL,
START_DATE DATE NOT NULL,
END_DATE DATE NOT NULL,
NAME VARCHAR(20) NOT NULL,
LABEL VARCHAR(20),
DESCRIPTION VARCHAR(1000),
PRIMARY KEY (GOAL_ID)
);
CREATE TABLE SBI_GOAL_HIERARCHY (
GOAL_HIERARCHY_ID INTEGER NOT NULL AUTO_INCREMENT,
ORG_UNIT_ID INTEGER NOT NULL,
GOAL_ID INTEGER NOT NULL,
PARENT_ID INTEGER,
NAME VARCHAR(50) NOT NULL,
LABEL VARCHAR(50),
GOAL VARCHAR(1000) ,
PRIMARY KEY (GOAL_HIERARCHY_ID)
);
CREATE TABLE SBI_GOAL_KPI (
GOAL_KPI_ID INTEGER NOT NULL AUTO_INCREMENT,
KPI_INSTANCE_ID INTEGER NOT NULL,
GOAL_HIERARCHY_ID INTEGER NOT NULL,
WEIGHT1 DOUBLE,
WEIGHT2 DOUBLE,
THRESHOLD1 DOUBLE,
THRESHOLD2 DOUBLE,
THRESHOLD1SIGN INTEGER,
THRESHOLD2SIGN INTEGER,
PRIMARY KEY (GOAL_KPI_ID)
);
ALTER TABLE SBI_GOAL_KPI ENGINE = InnoDB;
ALTER TABLE SBI_GOAL_HIERARCHY ENGINE = InnoDB;
ALTER TABLE SBI_GOAL ENGINE = InnoDB;
ALTER TABLE SBI_GOAL ADD CONSTRAINT FK_GRANT_ID_GRANT FOREIGN KEY FK_GRANT_ID_GRANT (GRANT_ID) REFERENCES SBI_ORG_UNIT_GRANT (ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_GOAL_HIERARCHY ADD CONSTRAINT FK_SBI_GOAL_HIERARCHY_GOAL FOREIGN KEY FK_SBI_GOAL_HIERARCHY_GOAL (GOAL_ID) REFERENCES SBI_GOAL (GOAL_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_GOAL_HIERARCHY ADD CONSTRAINT FK_SBI_GOAL_HIERARCHY_PARENT FOREIGN KEY FK_SBI_GOAL_HIERARCHY_PARENT (PARENT_ID) REFERENCES SBI_GOAL_HIERARCHY (GOAL_HIERARCHY_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_GOAL_KPI ADD CONSTRAINT FK_SBI_GOAL_KPI_GOAL FOREIGN KEY FK_SBI_GOAL_KPI_GOAL (GOAL_HIERARCHY_ID) REFERENCES SBI_GOAL_HIERARCHY (GOAL_HIERARCHY_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_GOAL_KPI ADD CONSTRAINT FK_SBI_GOAL_KPI_KPI FOREIGN KEY FK_SBI_GOAL_KPI_KPI (KPI_INSTANCE_ID) REFERENCES SBI_KPI_MODEL_INST (KPI_MODEL_INST) ON DELETE CASCADE ON UPDATE RESTRICT;
--Chiara 22/03/2011: dataset scripts
ALTER TABLE SBI_DATA_SET ADD COLUMN CATEGORY_ID INTEGER;
ALTER TABLE SBI_DATA_SET ADD CONSTRAINT FK_SBI_DATA_SET_CAT FOREIGN KEY FK_SBI_DATA_SET_CAT (CATEGORY_ID) REFERENCES SBI_DOMAINS (VALUE_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
--Chiara 30/03/2011
ALTER TABLE SBI_DATA_SET DROP COLUMN EXECUTOR_CLASS;
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('groovy','Groovy','SCRIPT_TYPE','Script Type','Script Type');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('rhino-nonjdk','Javascript','SCRIPT_TYPE','Script Type','Script Type');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('ejs','Embedded Javascript','SCRIPT_TYPE','Script Type','Script Type');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('File','SbiFileDataSet','DATA_SET_TYPE','Data Set Type','SbiFileDataSet');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Query','SbiQueryDataSet','DATA_SET_TYPE','Data Set Type','SbiQueryDataSet');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Java Class','SbiJClassDataSet','DATA_SET_TYPE','Data Set Type','SbiJClassDataSet');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Web Service','SbiWSDataSet','DATA_SET_TYPE','Data Set Type','SbiWSDataSet');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Script','SbiScriptDataSet','DATA_SET_TYPE','Data Set Type','SbiScriptDataSet');
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Qbe','SbiQbeDataSet','DATA_SET_TYPE','Data Set Type','SbiQbeDataSet');
CREATE TABLE SBI_DATA_SET_HISTORY (
DS_H_ID INTEGER NOT NULL AUTO_INCREMENT,
DS_ID INTEGER NOT NULL,
ACTIVE BOOLEAN NOT NULL,
VERSION_NUM INTEGER NOT NULL,
OBJECT_TYPE VARCHAR(50),
DS_METADATA VARCHAR(2000),
PARAMS VARCHAR(1000),
CATEGORY_ID INTEGER,
FILE_NAME VARCHAR(300),
QUERY TEXT,
DATA_SOURCE_ID INTEGER,
ADRESS VARCHAR(250),
OPERATION VARCHAR(50),
JCLASS_NAME VARCHAR(100),
LANGUAGE_SCRIPT VARCHAR(50),
SCRIPT TEXT,
JSON_QUERY TEXT,
TRANSFORMER_ID INTEGER,
PIVOT_COLUMN VARCHAR(50),
PIVOT_ROW VARCHAR(50),
PIVOT_VALUE VARCHAR(50),
NUM_ROWS BOOLEAN DEFAULT FALSE,
USER_IN VARCHAR(100) NOT NULL,
TIME_IN TIMESTAMP NOT NULL,
META_VERSION VARCHAR(100),
SBI_VERSION_IN VARCHAR(10),
PRIMARY KEY (DS_H_ID)
)TYPE=INNODB;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_T FOREIGN KEY FK_SBI_DATA_SET_T ( TRANSFORMER_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_CAT FOREIGN KEY FK_SBI_DATA_SET_CAT (CATEGORY_ID) REFERENCES SBI_DOMAINS (VALUE_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_DS FOREIGN KEY FK_SBI_DATA_SET_DS ( DATA_SOURCE_ID ) REFERENCES SBI_DATA_SOURCE ( DS_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_DS2 FOREIGN KEY FK_SBI_DATA_SET_DS2 (DS_ID) REFERENCES SBI_DATA_SET (DS_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
INSERT INTO SBI_DATA_SET_HISTORY
(DS_ID,ACTIVE,VERSION_NUM,FILE_NAME,QUERY,JCLASS_NAME,SCRIPT,PARAMS,DS_METADATA,DATA_SOURCE_ID
,OBJECT_TYPE,OPERATION,TRANSFORMER_ID,PIVOT_COLUMN,PIVOT_ROW,PIVOT_VALUE,NUM_ROWS,LANGUAGE_SCRIPT
,USER_IN, TIME_IN)
SELECT DS_ID,true ACTIVE,1 VERSION_NUM,FILE_NAME,QUERY,JCLASS_NAME,SCRIPT,PARAMS,DS_METADATA,DATA_SOURCE_ID
,OBJECT_TYPE,OPERATION,TRANSFORMER_ID,PIVOT_COLUMN,PIVOT_ROW,PIVOT_VALUE,NUM_ROWS,LANGUAGE_SCRIPT
,'biadmin' USER_IN, now() TIME_IN
FROM SBI_DATA_SET;
commit;
--Drop all SBI_DATA_SET foreign keys
ALTER TABLE SBI_DATA_SET DROP FOREIGN KEY FK_SBI_DATA_SET_1;
ALTER TABLE SBI_DATA_SET DROP FOREIGN KEY FK_SBI_DATA_SET_CAT;
ALTER TABLE SBI_DATA_SET DROP COLUMN CATEGORY_ID;
ALTER TABLE SBI_DATA_SET DROP COLUMN FILE_NAME;
ALTER TABLE SBI_DATA_SET DROP COLUMN QUERY;
ALTER TABLE SBI_DATA_SET DROP COLUMN JCLASS_NAME;
ALTER TABLE SBI_DATA_SET DROP COLUMN SCRIPT;
ALTER TABLE SBI_DATA_SET DROP COLUMN PARAMS;
ALTER TABLE SBI_DATA_SET DROP COLUMN DS_METADATA;
ALTER TABLE SBI_DATA_SET DROP COLUMN DATA_SOURCE_ID;
ALTER TABLE SBI_DATA_SET DROP COLUMN OBJECT_TYPE;
ALTER TABLE SBI_DATA_SET DROP COLUMN OPERATION;
ALTER TABLE SBI_DATA_SET DROP COLUMN TRANSFORMER_ID;
ALTER TABLE SBI_DATA_SET DROP COLUMN PIVOT_COLUMN;
ALTER TABLE SBI_DATA_SET DROP COLUMN PIVOT_ROW;
ALTER TABLE SBI_DATA_SET DROP COLUMN PIVOT_VALUE;
ALTER TABLE SBI_DATA_SET DROP COLUMN NUM_ROWS;
ALTER TABLE SBI_DATA_SET DROP COLUMN LANGUAGE_SCRIPT;
ALTER TABLE SBI_DATA_SET DROP COLUMN ADRESS;
ALTER TABLE SBI_DATA_SET ADD COLUMN USER_IN VARCHAR(100) NOT NULL;
ALTER TABLE SBI_DATA_SET ADD COLUMN USER_UP VARCHAR(100);
ALTER TABLE SBI_DATA_SET ADD COLUMN USER_DE VARCHAR(100);
ALTER TABLE SBI_DATA_SET ADD COLUMN TIME_IN TIMESTAMP NOT NULL;
ALTER TABLE SBI_DATA_SET ADD COLUMN TIME_UP TIMESTAMP;
ALTER TABLE SBI_DATA_SET ADD COLUMN TIME_DE TIMESTAMP;
ALTER TABLE SBI_DATA_SET ADD COLUMN SBI_VERSION_IN VARCHAR(10);
ALTER TABLE SBI_DATA_SET ADD COLUMN SBI_VERSION_UP VARCHAR(10);
ALTER TABLE SBI_DATA_SET ADD COLUMN SBI_VERSION_DE VARCHAR(10);
ALTER TABLE SBI_DATA_SET ADD COLUMN META_VERSION VARCHAR(100);
ALTER TABLE SBI_DATA_SET ADD COLUMN ORGANIZATION VARCHAR(20);
UPDATE SBI_DATA_SET SET USER_IN = 'biadmin';
--Chiara 4/4/2011
ALTER TABLE SBI_DATA_SET DROP COLUMN TIME_UP;
ALTER TABLE SBI_DATA_SET DROP COLUMN TIME_DE;
ALTER TABLE SBI_DATA_SET ADD COLUMN TIME_UP TIMESTAMP NULL DEFAULT NULL;
ALTER TABLE SBI_DATA_SET ADD COLUMN TIME_DE TIMESTAMP NULL DEFAULT NULL;
--Davide 12/04/2011
delete from SBI_DOMAINS WHERE VALUE_CD = 'Qbe' AND DOMAIN_CD = 'DATA_SET_TYPE';
INSERT into SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) values ('Qbe','SbiQbeDataSet','DATA_SET_TYPE','Data Set Type','SbiQbeDataSet');
ALTER TABLE SBI_DATA_SET_HISTORY ADD COLUMN DATAMARTS VARCHAR(400);
Angelo 13/04/2011
CREATE TABLE `hibernate_sequences` (
`sequence_name` varchar(200) NOT NULL,
`next_val` int(11) NOT NULL,
PRIMARY KEY (`sequence_name`)
);
Chiara 15/04/2011
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('groovy','Groovy','SCRIPT_TYPE','Script Type','Script Type');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('rhino-nonjdk','Javascript','SCRIPT_TYPE','Script Type','Script Type');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('ejs','Embedded Javascript','SCRIPT_TYPE','Script Type','Script Type');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('File','SbiFileDataSet','DATA_SET_TYPE','Data Set Type','SbiFileDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('Query','SbiQueryDataSet','DATA_SET_TYPE','Data Set Type','SbiQueryDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('Java Class','SbiJClassDataSet','DATA_SET_TYPE','Data Set Type','SbiJClassDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('Web Service','SbiWSDataSet','DATA_SET_TYPE','Data Set Type','SbiWSDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('Script','SbiScriptDataSet','DATA_SET_TYPE','Data Set Type','SbiScriptDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('Qbe','SbiQbeDataSet','DATA_SET_TYPE','Data Set Type','SbiQbeDataSet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('WORKSHEET','sbidomains.nm.worksheet','BIOBJ_TYPE','BI Object types','sbidomains.ds.worksheet');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('DEVELOPMENT', 'sbidomains.permissiononfolder.nm.dev','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.dev');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('TEST', 'sbidomains.permissiononfolder.nm.test','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.test');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('EXECUTION', 'sbidomains.permissiononfolder.nm.execute','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.execute');
INSERT INTO SBI_DOMAINS (VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS) VALUES ('CREATION', 'sbidomains.permissiononfolder.nm.create','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.create');
UPDATE SBI_FUNC_ROLE SET STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'DEVELOPMENT' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'DEVELOPMENT' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'DEV' AND DOMAIN_CD = 'STATE');
UPDATE SBI_FUNC_ROLE SET STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'TEST' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'TEST' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'TEST' AND DOMAIN_CD = 'STATE');
UPDATE SBI_FUNC_ROLE SET STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'EXECUTION' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'EXECUTION' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'REL' AND DOMAIN_CD = 'STATE');
INSERT INTO SBI_USER_FUNC (NAME, DESCRIPTION) VALUES ('DomainManagement', 'DomainManagement');
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'ADMIN'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='DomainManagement'));
INSERT INTO SBI_USER_FUNC (NAME, DESCRIPTION) VALUES ('ConfigManagement', 'ConfigManagement');
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'ADMIN'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='ConfigManagement'));
INSERT INTO SBI_USER_FUNC (NAME, DESCRIPTION) VALUES ('UserSaveDocumentFunctionality', 'UserSaveDocumentFunctionality');
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'ADMIN'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='UserSaveDocumentFunctionality'));
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'USER'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='UserSaveDocumentFunctionality'));
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'DEV_ROLE'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='UserSaveDocumentFunctionality'));
INSERT INTO SBI_ROLE_TYPE_USER_FUNC values((SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ROLE_TYPE' AND VALUE_CD = 'TEST_ROLE'), (SELECT USER_FUNCT_ID FROM SBI_USER_FUNC WHERE NAME='UserSaveDocumentFunctionality'));
INSERT INTO SBI_ENGINES (NAME,ENCRYPT, LABEL,MAIN_URL, DRIVER_NM, ENGINE_TYPE,BIOBJ_TYPE,USE_DATASOURCE,USE_DATASET) VALUES
('Worksheet Engine', 0,'WorksheetEngine','/SpagoBIQbeEngine/servlet/AdapterHTTP','it.eng.spagobi.engines.drivers.worksheet.WorksheetDriver',(SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'ENGINE_TYPE' AND VALUE_CD = 'EXT'),(SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'BIOBJ_TYPE' AND VALUE_CD = 'WORKSHEET'),true,false);
CREATE TABLE SBI_DATA_SET_HISTORY (
DS_H_ID INTEGER NOT NULL AUTO_INCREMENT,
DS_ID INTEGER NOT NULL,
ACTIVE BOOLEAN NOT NULL,
VERSION_NUM INTEGER NOT NULL,
OBJECT_TYPE VARCHAR(50),
DS_METADATA VARCHAR(2000),
PARAMS VARCHAR(1000),
CATEGORY_ID INTEGER,
FILE_NAME VARCHAR(300),
QUERY TEXT,
DATA_SOURCE_ID INTEGER,
ADRESS VARCHAR(250),
OPERATION VARCHAR(50),
JCLASS_NAME VARCHAR(100),
LANGUAGE_SCRIPT VARCHAR(50),
SCRIPT TEXT,
JSON_QUERY TEXT,
DATAMARTS VARCHAR(400),
TRANSFORMER_ID INTEGER,
PIVOT_COLUMN VARCHAR(50),
PIVOT_ROW VARCHAR(50),
PIVOT_VALUE VARCHAR(50),
NUM_ROWS BOOLEAN DEFAULT FALSE,
USER_IN VARCHAR(100) NOT NULL,
TIME_IN TIMESTAMP NOT NULL,
META_VERSION VARCHAR(100),
SBI_VERSION_IN VARCHAR(10),
PRIMARY KEY (DS_H_ID)
)TYPE=INNODB;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_T FOREIGN KEY ( TRANSFORMER_ID ) REFERENCES SBI_DOMAINS ( VALUE_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_CAT FOREIGN KEY (CATEGORY_ID) REFERENCES SBI_DOMAINS (VALUE_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_DS FOREIGN KEY ( DATA_SOURCE_ID ) REFERENCES SBI_DATA_SOURCE ( DS_ID ) ON DELETE CASCADE;
ALTER TABLE SBI_DATA_SET_HISTORY ADD CONSTRAINT FK_SBI_DATA_SET_DS2 FOREIGN KEY (DS_ID) REFERENCES SBI_DATA_SET (DS_ID) ON DELETE CASCADE ON UPDATE RESTRICT;
INSERT INTO SBI_DATA_SET_HISTORY
(DS_H_ID,DS_ID,ACTIVE,VERSION_NUM,FILE_NAME,QUERY,JCLASS_NAME,SCRIPT,PARAMS,DS_METADATA
,DATA_SOURCE_ID,OBJECT_TYPE,OPERATION,TRANSFORMER_ID,PIVOT_COLUMN,PIVOT_ROW
,PIVOT_VALUE,NUM_ROWS,LANGUAGE_SCRIPT,USER_IN, TIME_IN)
SELECT DS_ID, DS_ID,true ACTIVE,1 VERSION_NUM,FILE_NAME,QUERY,JCLASS_NAME,SCRIPT,PARAMS,DS_METADATA,DATA_SOURCE_ID
,OBJECT_TYPE,OPERATION,TRANSFORMER_ID,PIVOT_COLUMN,PIVOT_ROW,PIVOT_VALUE,NUM_ROWS,LANGUAGE_SCRIPT
,'biadmin' USER_IN, NOW() TIME_IN
FROM SBI_DATA_SET;
commit;
Angelo 19/04/2011
AGGIUNTI I CAMPI TECNICI , ESEGUIRE UpdateTecnologyFields.sql
--Davide 23/05/2011: permissions on folders
INSERT into SBI_DOMAINS (VALUE_ID, VALUE_CD, VALUE_NM, DOMAIN_CD, DOMAIN_NM,VALUE_DS, USER_IN) values ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'), 'DEVELOPMENT', 'sbidomains.permissiononfolder.nm.dev','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.dev', '');
UPDATE hibernate_sequences SET next_val = (SELECT MAX(VALUE_ID) + 1 FROM SBI_DOMAINS) WHERE sequence_name = 'SBI_DOMAINS';
INSERT into SBI_DOMAINS (VALUE_ID, VALUE_CD, VALUE_NM, DOMAIN_CD, DOMAIN_NM,VALUE_DS, USER_IN) values ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'), 'TEST', 'sbidomains.permissiononfolder.nm.test','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.test', '');
UPDATE hibernate_sequences SET next_val = (SELECT MAX(VALUE_ID) + 1 FROM SBI_DOMAINS) WHERE sequence_name = 'SBI_DOMAINS';
INSERT into SBI_DOMAINS (VALUE_ID, VALUE_CD, VALUE_NM, DOMAIN_CD, DOMAIN_NM,VALUE_DS, USER_IN) values ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'), 'EXECUTION', 'sbidomains.permissiononfolder.nm.execute','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.execute', '');
UPDATE hibernate_sequences SET next_val = (SELECT MAX(VALUE_ID) + 1 FROM SBI_DOMAINS) WHERE sequence_name = 'SBI_DOMAINS';
INSERT into SBI_DOMAINS (VALUE_ID, VALUE_CD, VALUE_NM, DOMAIN_CD, DOMAIN_NM,VALUE_DS, USER_IN) values ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'), 'CREATION', 'sbidomains.permissiononfolder.nm.create','PERMISSION_ON_FOLDER','Permission on folder','sbidomains.permissiononfolder.ds.create', '');
UPDATE hibernate_sequences SET next_val = (SELECT MAX(VALUE_ID) + 1 FROM SBI_DOMAINS) WHERE sequence_name = 'SBI_DOMAINS';
UPDATE SBI_FUNC_ROLE set STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'DEVELOPMENT' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'DEVELOPMENT' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'DEV' AND DOMAIN_CD = 'STATE');
UPDATE SBI_FUNC_ROLE set STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'TEST' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'TEST' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'TEST' AND DOMAIN_CD = 'STATE');
UPDATE SBI_FUNC_ROLE set STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'EXECUTION' AND DOMAIN_CD = 'PERMISSION_ON_FOLDER'), STATE_CD = 'EXECUTION' WHERE STATE_ID = (SELECT VALUE_ID FROM SBI_DOMAINS WHERE VALUE_CD = 'REL' AND DOMAIN_CD = 'STATE');
--Chiara 30/05/2011
INSERT INTO SBI_EXPORTERS (ENGINE_ID,DOMAIN_ID,DEFAULT_VALUE)values((SELECT ENGINE_ID FROM SBI_ENGINES WHERE LABEL='WorksheetEngine'),(SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'EXPORT_TYPE' AND VALUE_CD = 'XLS'), false);
--Monia 30/05/2011
ALTER TABLE SBI_CONFIG ADD COLUMN CATEGORY VARCHAR( 50 ) NULL
--Chiara 15/06/2011
--If this is not the correct name of your foreign key delete it manually
ALTER TABLE SBI_KPI_DOCUMENTS DROP FOREIGN KEY sbi_kpi_documents_ibfk_1;
ALTER TABLE SBI_KPI_DOCUMENTS ADD CONSTRAINT FK_SBI_KPI_DOCUMENTS_1 FOREIGN KEY ( BIOBJ_ID ) REFERENCES SBI_OBJECTS ( BIOBJ_ID ) ON DELETE CASCADE ON UPDATE CASCADE;
--Monica 11/07/2011
ALTER TABLE SBI_ORG_UNIT_GRANT ADD COLUMN IS_AVAILABLE INTEGER DEFAULT 1;
-- GIULIO 20/07/2011
CREATE TABLE SBI_OBJ_PARVIEW (
OBJ_PAR_ID INTEGER NOT NULL,
OBJ_PAR_FATHER_ID INTEGER NOT NULL,
OPERATION VARCHAR(20) NOT NULL,
COMPARE_VALUE VARCHAR(200) NOT NULL,
VIEW_LABEL VARCHAR(50),
PROG INTEGER,
USER_IN VARCHAR(100) NOT NULL,
USER_UP VARCHAR(100),
USER_DE VARCHAR(100),
TIME_IN TIMESTAMP NOT NULL,
TIME_UP TIMESTAMP NULL DEFAULT NULL,
TIME_DE TIMESTAMP NULL DEFAULT NULL,
SBI_VERSION_IN VARCHAR(10),
SBI_VERSION_UP VARCHAR(10),
SBI_VERSION_DE VARCHAR(10),
META_VERSION VARCHAR(100),
ORGANIZATION VARCHAR(20),
PRIMARY KEY ( OBJ_PAR_ID , OBJ_PAR_FATHER_ID , OPERATION, COMPARE_VALUE )
);
CREATE INDEX XAK1SBI_PARVIEW ON SBI_OBJ_PARVIEW
(
OBJ_PAR_ID ASC,
OBJ_PAR_FATHER_ID ASC
);
ALTER TABLE SBI_OBJ_PARVIEW ADD CONSTRAINT FK_SBI_OBJ_PARVIEW_1 FOREIGN KEY ( OBJ_PAR_ID ) REFERENCES SBI_OBJ_PAR ( OBJ_PAR_ID ) ON DELETE RESTRICT;
ALTER TABLE SBI_OBJ_PARVIEW ADD CONSTRAINT FK_SBI_OBJ_PARVIEW_2 FOREIGN KEY ( OBJ_PAR_FATHER_ID ) REFERENCES SBI_OBJ_PAR ( OBJ_PAR_ID ) ON DELETE RESTRICT;
-- Change after 3.1 14/9/2011 Giulio
ALTER TABLE sbi_data_set_history ADD COLUMN CUSTOM_DATA TEXT AFTER DATAMARTS;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'Custom','SbiCustomDataSet','DATA_SET_TYPE','Data Set Type','SbiCustomDataSet', 'biadmin');
-- 6/10/2011 Giulio
ALTER TABLE sbi_data_set_history MODIFY COLUMN DS_METADATA TEXT;
-- 20/10/2011 Davide : il motore worksheet può lavorare con i dataset
UPDATE SBI_ENGINES SET USE_DATASET = TRUE WHERE DRIVER_NM = 'it.eng.spagobi.engines.drivers.worksheet.WorksheetDriver';
-- 06/12/2011 Davide : exporter XLSX per Qbe e Worksheet
INSERT INTO SBI_DOMAINS (VALUE_ID,VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS,USER_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'XLSX','XLSX','EXPORT_TYPE','Exporters type','Export type', 'biadmin');
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_EXPORTERS (ENGINE_ID,DOMAIN_ID,DEFAULT_VALUE)
VALUES ((SELECT ENGINE_ID FROM SBI_ENGINES WHERE DRIVER_NM = 'it.eng.spagobi.engines.drivers.worksheet.WorksheetDriver'),
(SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'EXPORT_TYPE' AND VALUE_CD = 'XLSX'),
false);
commit;
INSERT INTO SBI_EXPORTERS (ENGINE_ID,DOMAIN_ID,DEFAULT_VALUE)
VALUES ((SELECT ENGINE_ID FROM SBI_ENGINES WHERE DRIVER_NM = 'it.eng.spagobi.engines.drivers.qbe.QbeDriver'),
(SELECT VALUE_ID FROM SBI_DOMAINS WHERE DOMAIN_CD = 'EXPORT_TYPE' AND VALUE_CD = 'XLSX'),
false);
commit;
Change after 3.1 14/9/2011 Giulio
-- 6/12/2011 Giulio
CREATE TABLE SBI_I18N_MESSAGES (
LANGUAGE_CD INTEGER NOT NULL,
LABEL VARCHAR(200) NOT NULL,
MESSAGE TEXT,
PRIMARY KEY (LANGUAGE_CD, LABEL)
);
ALTER TABLE SBI_I18N_MESSAGES ADD CONSTRAINT FK_SBI_I18N_MESSAGES FOREIGN KEY (LANGUAGE_CD) REFERENCES SBI_DOMAINS(VALUE_ID);
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'ITA','Italian','LANG','language ISO Code','Italian', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'ENG','English','LANG','language ISO Code','English', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'FRA','French','LANG','language ISO Code','French', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibRernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'SPA','Spanish','LANG','language ISO Code','Spanish', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
--Monica 20/12/11
CREATE TABLE SBI_KPI_COMMENTS(
KPI_COMMENT_ID int(11) NOT NULL AUTO_INCREMENT,
KPI_INST_ID int(11) DEFAULT NULL,
BIN_ID int(11) DEFAULT NULL,
EXEC_REQ varchar(500) DEFAULT NULL,
OWNER varchar(50) DEFAULT NULL,
ISPUBLIC tinyint(1) DEFAULT NULL,
CREATION_DATE timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
LAST_CHANGE_DATE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
USER_IN varchar(100) NOT NULL,
USER_UP varchar(100) DEFAULT NULL,
USER_DE varchar(100) DEFAULT NULL,
TIME_IN timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
TIME_UP timestamp NULL DEFAULT NULL,
TIME_DE timestamp NULL DEFAULT NULL,
SBI_VERSION_IN varchar(10) DEFAULT NULL,
SBI_VERSION_UP varchar(10) DEFAULT NULL,
SBI_VERSION_DE varchar(10) DEFAULT NULL,
META_VERSION varchar(100) DEFAULT NULL,
ORGANIZATION varchar(20) DEFAULT NULL,
PRIMARY KEY (KPI_COMMENT_ID),
UNIQUE KEY XAK1SBI_KPI_COMMENT (KPI_COMMENT_ID),
KEY FK_SBI_KPI_COMMENT_1 (BIN_ID),
KEY FK_SBI_KPI_COMMENT_2 (KPI_INST_ID),
CONSTRAINT FK_SBI_KPI_COMMENT_1 FOREIGN KEY (BIN_ID) REFERENCES SBI_BINARY_CONTENTS (BIN_ID),
CONSTRAINT FK_SBI_KPI_COMMENT_2 FOREIGN KEY (KPI_INST_ID) REFERENCES SBI_KPI_INSTANCE (ID_KPI_INSTANCE)
);
// 23/01/2012 Giulio
CREATE TABLE SBI_PROGRESS_THREAD (
PROGRESS_THREAD_ID INTEGER NOT NULL,
USER_ID VARCHAR(100) NOT NULL,
PARTIAL INTEGER,
TOTAL INTEGER,
FUNCTION_CD VARCHAR(200),
STATUS VARCHAR(4000),
RANDOM_KEY VARCHAR(4000),
TYPE VARCHAR(200),
PRIMARY KEY (PROGRESS_THREAD_ID)
)
insert into hibernate_sequences(next_val,sequence_name) values (ifnull((select max(PROGRESS_THREAD_ID)+1 from SBI_PROGRESS_THREAD) ,1),'SBI_PROGRESS_THREAD');
ALTER TABLE SBI_EXT_ROLES ADD COLUMN DO_MASSIVE_EXPORT BOOLEAN DEFAULT TRUE;
-- monica 03/02/2012
ALTER TABLE SBI_UDP_VALUE MODIFY COLUMN VALUE VARCHAR(1000) CHARACTER SET latin1 COLLATE latin1_swedish_ci DEFAULT NULL;
-- 6 febbraio
INSERT INTO SBI_CONFIG ( ID, LABEL, NAME, DESCRIPTION, IS_ACTIVE, VALUE_CHECK, VALUE_TYPE_ID, USER_IN) VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_CONFIG'),'JNDI_THREAD_MANAGER', 'JNDI_THREAD_MANAGER', 'Jndi to build work manager', true, 'java:/comp/env/wm/SpagoWorkManager',(select VALUE_ID from SBI_DOMAINS where VALUE_CD = 'STRING' AND DOMAIN_CD = 'PAR_TYPE'), 'biadmin');=======
-- 22/02/2012 Monica
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'MOBILE_TABLE','sbidomains.nm.mobile.table','BIOBJ_TYPE','BI Object types','sbidomains.ds.mobile.table', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'MOBILE_CHART','sbidomains.nm.mobile.chart','BIOBJ_TYPE','BI Object types','sbidomains.ds.mobile.chart', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;
INSERT INTO SBI_DOMAINS (VALUE_ID, VALUE_CD,VALUE_NM,DOMAIN_CD,DOMAIN_NM,VALUE_DS, USER_IN, TIME_IN)
VALUES ((SELECT next_val FROM hibernate_sequences WHERE sequence_name = 'SBI_DOMAINS'),
'MOBILE_COMPOSED','sbidomains.nm.mobile.composed','BIOBJ_TYPE','BI Object types','sbidomains.ds.mobile.composed', 'biadmin', current_timestamp);
update hibernate_sequences set next_val = next_val+1 where sequence_name = 'SBI_DOMAINS';
commit;