· 6 years ago · Jan 15, 2020, 07:06 AM
1if varexists('dbversion') = 0 then create variable dbversion char(30); endif;
2if varexists('dbversion_require') = 0 then create variable dbversion_require char(30); endif;
3
4set dbversion = '11.2.3';
5set dbversion_require = '11.2';
6
7--Prüfen, ob die DB für die Ausführung dieses Scripts die korrekte Version hat
8if not exists (select ve1_a3bs from version where ve1_a3bs = dbversion_require) then
9 raiserror 99999 'Die Ausführung von Script Version baustoff' + dbversion + ' erfordert die DB-Version baustoff' + dbversion_require;
10end if;
11
12
13
14drop table if exists baustelle_abo_recall_termin;
15create table baustelle_abo_recall_termin(
16 bart2_id integer not null default autoincrement,
17 bart2_recall_id integer not null,
18 bart2_geplant timestamp,
19 bart2_status char(1), /*i = ignoriert, z = zugewiesen Dispo-Status, e = erfasst*/
20 bart2_erstellt timestamp,
21 bart2_erstellt_durch char(256),
22 bart2_gespeichert timestamp,
23 bart2_gespeichert_durch char(256),
24 constraint "pk_baustelle_abo_recall_termin" primary key (bart2_id),
25 constraint "fk_baustelle_abo_recall" foreign key (bart2_recall_id) references "baustelle_abo_recall"(bar2_id) on delete cascade
26);
27
28alter table lda_kopf add l2_abo_termin integer ;
29alter table lda_kopf add constraint "fk_lda_kopf_recall_termin" foreign key(l2_abo_termin) references baustelle_abo_recall_termin(bart2_id) on delete restrict;
30
31alter table baustelle_abo_recall add bar2_berechnet_bis timestamp;
32alter table baustelle_abo_recall add bar2_gespeichert timestamp;
33alter table baustelle_abo_recall add bar2_gespeichert_durch char(256);
34
35alter table baustelle_abo_recall rename bar2_toleranz_tage to deprecated_bar2_toleranz_tage;
36
37alter trigger "tr_insert_baustelle_abo" after insert on org.baustelle_abo
38referencing new as new_baustelle_abo
39for each row
40begin
41 insert into org.baustelle_abo_recall(bar2_abo_id,bar2_tag,bar2_wochentag,bar2_jan,bar2_feb,bar2_mar,bar2_apr,bar2_mai,bar2_jun,bar2_jul,bar2_aug,bar2_sep,bar2_okt,bar2_nov,bar2_dez,bar2_fix,bar2_meldet_sich,bar2_recall_typ,bar2_jahr )
42 select new_baustelle_abo.ba2_abo_id,1,1,'n','n','n','n','n','n','n','n','n','n','n','n','n','n',1,1 from org.baustelle_abo where ba2_abo_id = new_baustelle_abo.ba2_abo_id
43end;
44
45INSERT INTO "org"."stm_funktion" ("fun1_id","fun1_parent_id","fun1_bez_menu","fun1_order","fun1_enabled","fun1_visible","fun1_folder","fun1_treevisibility","fun1_parameter","fun1_shortcut","fun1_bez_resultlist","fun1_toolbar_windowname","fun1_toolbar_bez","fun1_toolbar_picturename","fun1_toolbar_tooltip","fun1_toolbar_order","fun1_toolbar_space","fun1_toolbar_alignright","fun1_toolbar_row","fun1_bez_menu_tbz_nr","fun1_bez_resultlist_tbz_nr","fun1_toolbar_bez_tbz_nr","fun1_toolbar_tooltip_tbz_nr","fun1_toolbar_showbez","fun1_security_object_id") VALUES('OBJ2008',NULL,NULL,NULL,1,1,0,0,NULL,'Ctrl+S',NULL,'w_obj_select_abo','Speichern','save.gif','Speichern',100,NULL,NULL,NULL,NULL,NULL,11000234,11000234,1,NULL);
46INSERT INTO "org"."stm_funktion" ("fun1_id","fun1_parent_id","fun1_bez_menu","fun1_order","fun1_enabled","fun1_visible","fun1_folder","fun1_treevisibility","fun1_parameter","fun1_shortcut","fun1_bez_resultlist","fun1_toolbar_windowname","fun1_toolbar_bez","fun1_toolbar_picturename","fun1_toolbar_tooltip","fun1_toolbar_order","fun1_toolbar_space","fun1_toolbar_alignright","fun1_toolbar_row","fun1_bez_menu_tbz_nr","fun1_bez_resultlist_tbz_nr","fun1_toolbar_bez_tbz_nr","fun1_toolbar_tooltip_tbz_nr","fun1_toolbar_showbez","fun1_security_object_id") VALUES('OBJ2009',NULL,NULL,NULL,1,1,0,0,NULL,'Ctrl+N',NULL,'w_obj_select_abo','Neu','new.gif','Neu',200,NULL,NULL,NULL,NULL,NULL,11000261,11000261,1,NULL);
47INSERT INTO "org"."stm_funktion" ("fun1_id","fun1_parent_id","fun1_bez_menu","fun1_order","fun1_enabled","fun1_visible","fun1_folder","fun1_treevisibility","fun1_parameter","fun1_shortcut","fun1_bez_resultlist","fun1_toolbar_windowname","fun1_toolbar_bez","fun1_toolbar_picturename","fun1_toolbar_tooltip","fun1_toolbar_order","fun1_toolbar_space","fun1_toolbar_alignright","fun1_toolbar_row","fun1_bez_menu_tbz_nr","fun1_bez_resultlist_tbz_nr","fun1_toolbar_bez_tbz_nr","fun1_toolbar_tooltip_tbz_nr","fun1_toolbar_showbez","fun1_security_object_id") VALUES('OBJ2010',NULL,NULL,NULL,1,1,0,0,NULL,'Ctrl+Del',NULL,'w_obj_select_abo','Löschen','delete.png','Löschen',300,NULL,NULL,NULL,NULL,NULL,71001052,71001052,1,NULL);
48
49ALTER TABLE baustelle_abo_recall_termin ADD bart2_history_recall_parameter CHAR(1000);
50
51--Version erstellt
52update version set ve1_a3bs = dbversion;