Subversion Repositories public

Rev

Rev 4 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 andreas 1
/*
2
Created		13.10.2004
38 andreas 3
Modified	14.10.2007
4 andreas 4
Project		TheoPlan
5
Model		pm
6
Company		TheoSys
7
Author		Andreas Theofilu
8
Version		2.6
38 andreas 9
Database	PostgreSQL 8.1
4 andreas 10
*/
11
 
12
 
13
/* Create Schemas */
14
 
15
 
16
 
17
/* Create Tables */
18
 
19
 
20
Create table "public"."allocation"
21
(
22
	"al_num" Int8 Not Null,
38 andreas 23
	"al_task" Int8 Not Null,
24
	"al_ressource" Int8 Not Null,
4 andreas 25
	"al_hours" Double precision,
38 andreas 26
	"al_role" Int8,
27
	"al_phase" Int8,
28
	"al_pstart" Int8,
4 andreas 29
	"al_pduration" Smallint,
30
constraint "allocation_pkey" primary key ("al_num")
31
)
32
WITHOUT OIDS;
33
 
34
Create table "public"."counter"
35
(
36
	"co_mitarbeiter" Int8,
37
	"co_plan" Int8,
38
	"co_task" Int8,
39
	"co_wdone" Int8,
40
	"co_allocation" Int8,
41
	"co_ptemp" Int8,
42
	"co_tempidx" Int8,
43
	"co_charge" Int8,
44
	"co_kgroup" Int8,
45
	"co_kunde" Int8,
46
	"co_histanteil" Int8,
47
	"co_calendar" Int8,
48
	"co_ejournal" Int8,
49
	"co_abschluss" Int8,
50
	"co_planstatus" Int8,
51
	"co_dration" Int8,
52
	"co_tagsatz" Int8,
53
	"co_kgsammel" Int8,
54
	"co_fixanteil" Int8,
55
	"co_matopr" Int8,
56
	"version" Varchar(10)
57
)
58
WITHOUT OIDS;
59
 
60
Create table "public"."wdone"
61
(
62
	"wd_num" Int8 Not Null,
63
	"wd_prnum" Int8 Not Null,
64
	"wd_minum" Int8 Not Null,
65
	"wd_datum" Int8,
66
	"wd_hours" Double precision,
67
	"wd_task" Int8 Not Null,
68
	"wd_rk" Smallint,
69
	"wd_phase" Integer,
70
	"wd_edit" Boolean,
71
	"wd_text" Varchar(8192),
72
	"wd_verr" Boolean,
73
constraint "wdone_pkey" primary key ("wd_num")
74
)
75
WITHOUT OIDS;
76
 
77
Create table "public"."key_sgf"
78
(
79
	"ks_num" Int8 Not Null,
80
	"ks_sgf" Varchar(80),
81
constraint "key_sgf_pkey" primary key ("ks_num")
82
)
83
WITHOUT OIDS;
84
 
85
Create table "public"."key_abt"
86
(
87
	"ka_num" Int8 Not Null,
88
	"ka_abt" Varchar(50),
89
constraint "key_abt_pkey" primary key ("ka_num")
90
)WITHOUT OIDS;
91
 
92
Create table "public"."key_role"
93
(
94
	"kr_num" Int8 Not Null,
95
	"kr_role" Varchar(50),
96
constraint "key_role_pkey" primary key ("kr_num")
97
)
98
WITHOUT OIDS;
99
 
100
Create table "public"."key_tmgroup"
101
(
102
	"kt_num" Int8 Not Null,
103
	"kt_tm" Varchar(80),
104
constraint "key_tmgroup_pkey" primary key ("kt_num")
105
)
106
WITHOUT OIDS;
107
 
108
Create table "public"."key_land"
109
(
110
	"kl_num" Int8 Not Null,
111
	"kl_land" Varchar(50),
112
constraint "key_land_pkey" primary key ("kl_num")
113
)
114
WITHOUT OIDS;
115
 
116
Create table "public"."task"
117
(
118
	"ta_num" Int8 Not Null,
119
	"ta_plnum" Int8 Not Null,
120
	"ta_id" Smallint Not Null,
121
	"ta_depend" Smallint,
122
	"ta_deptype" Smallint,
123
	"ta_name" Varchar(50) Not Null,
124
	"ta_color" Integer,
125
	"ta_shape" Varchar(40),
126
	"ta_meeting" Smallint,
127
	"ta_start" Int8,
128
	"ta_duration" Smallint,
129
	"ta_complete" Smallint,
130
	"ta_fixed_start" Smallint,
131
	"ta_priority" Smallint,
132
	"ta_level" Smallint,
133
	"ta_notiz" Varchar(4096),
134
	"ta_phase" Integer,
135
	"ta_risiko" Smallint,
136
	"ta_hash" Char(34) Not Null,
137
constraint "task_pkey" primary key ("ta_num")
138
)
139
WITHOUT OIDS;
140
 
141
Create table "public"."ptemp"
142
(
143
	"pt_num" Int8 Not Null,
144
	"pt_tnum" Int8 Not Null,
145
	"pt_lfd" Smallint Not Null,
146
	"pt_level" Smallint,
147
	"pt_name" Varchar(50),
148
	"pt_color" Integer,
149
	"pt_meeting" Boolean,
150
	"pt_phase" Integer,
151
constraint "ptemp_pkey" primary key ("pt_num")
152
)
153
WITHOUT OIDS;
154
 
155
Create table "public"."project"
156
(
157
	"pr_num" Int8 Not Null,
158
	"pr_name" Varchar(100) Not Null Constraint "idx_project_name" UNIQUE,
159
	"pr_pl" Int8 Not Null,
160
	"pr_plav" Int8 Not Null,
161
	"pr_sgf" Int8 Not Null,
162
	"pr_tmgroup" Int8 Not Null,
163
	"pr_status" Smallint Not Null,
164
constraint "project_pkey" primary key ("pr_num")
165
)
166
WITHOUT OIDS;
167
 
168
Create table "public"."mitarbeiter"
169
(
170
	"mi_num" Int8 Not Null,
171
	"mi_vname" Varchar(50) Not Null,
172
	"mi_nname" Varchar(50) Not Null,
173
	"mi_land" Int8 Not Null,
174
	"mi_abt" Int8 Not Null,
175
	"mi_tel" Varchar(50),
176
	"mi_mail" Varchar(80),
177
	"mi_userid" Varchar(16) Constraint "Rel_mi_userid" UNIQUE,
178
	"mi_passwd" Varchar(50),
179
	"mi_rstufe" Smallint,
180
	"mi_hacker" Smallint,
181
	"mi_plan" Bool,
182
constraint "mitarbeiter_pkey" primary key ("mi_num")
183
)
184
WITHOUT OIDS;
185
 
186
CREATE TABLE "public"."key_whg"
187
(
38 andreas 188
   wh_num int8 NOT NULL,
4 andreas 189
   wh_whg char(5) NOT NULL, 
190
   wh_bez varchar(60), 
191
   CONSTRAINT pk_whg PRIMARY KEY (wh_num)
192
) WITHOUT OIDS;
193
 
194
Create table "public"."tagsatz"
195
(
196
	"tg_num" int8 NOT NULL, -- Interne laufende Nummer
197
	"tg_valid_from" date NOT NULL, -- Datum gueltig ab
198
	"tg_valid_to" date, -- Datum gueltig bis
199
	"tg_amount" float8, -- Tagsatz
200
	"tg_nightr" float8, -- Naechtigungspauschale
201
	"tg_ration" float8, -- Tagesdiaeten
202
	"tg_kmcar" float8, -- Kilometerpauschale PKW
203
	"tg_kmdrain" float8, -- Kilometerpauschale Zug
204
	"tg_kmplain" float8, -- Kilometerpauschale Flugzeug
205
	"tg_whg" int8 NOT NULL, -- Verknuepfung zur Waehrung
206
	"tg_minum" int8 NOT NULL, -- Verknuepfung zum Mitarbeiter
207
	CONSTRAINT "pk_tgnum" PRIMARY KEY ("tg_num"),
208
	CONSTRAINT "fk_minum_10" FOREIGN KEY ("tg_minum")
209
	    REFERENCES "public"."mitarbeiter" ("mi_num") MATCH SIMPLE
210
	    ON UPDATE RESTRICT ON DELETE RESTRICT,
211
	CONSTRAINT "fk_whg_10" FOREIGN KEY ("tg_whg")
212
	REFERENCES "public"."key_whg" ("wh_num") MATCH SIMPLE
213
	    ON UPDATE RESTRICT ON DELETE RESTRICT
214
) 
215
WITHOUT OIDS;
216
 
217
Create table "public"."key_phase"
218
(
219
	"kp_num" Int8 Not Null,
220
	"kp_phase" Varchar(60) Not Null,
221
constraint "key_phase_pkey" primary key ("kp_num")
222
)
223
WITHOUT OIDS;
224
 
225
Create table "public"."plan"
226
(
227
	"pl_num" Int8 Not Null,
228
	"pl_lfd" Integer Not Null,
229
	"pl_prnum" Int8 Not Null,
230
	"pl_status" Smallint Not Null,
231
	"pl_comment" Varchar(255),
232
	"pl_date" Timestamp Default current_timestamp,
233
constraint "plan_pkey" primary key ("pl_num")
234
)
235
WITHOUT OIDS;
236
 
237
CREATE TABLE "public"."planstatus"
238
(
239
	"ps_num" int8 NOT NULL,
240
	"ps_pl" int8 NOT NULL,
241
	"ps_prnum" int8 NOT NULL,
242
	"ps_plnum" int8 NOT NULL,
243
	"ps_status" bool NOT NULL DEFAULT true,
244
	"ps_comment" varchar(8192),
245
	"ps_datum" date,
246
	"ps_lfd" smallint,
247
	CONSTRAINT "psnum_pkey" PRIMARY KEY ("ps_num"),
248
	CONSTRAINT "pspl_fk" FOREIGN KEY ("ps_pl")
249
		REFERENCES mitarbeiter ("mi_num") MATCH SIMPLE
250
		ON UPDATE RESTRICT ON DELETE RESTRICT,
251
	CONSTRAINT "psplnum_fk" FOREIGN KEY ("ps_plnum")
252
		REFERENCES plan ("pl_num") MATCH SIMPLE
253
		ON UPDATE RESTRICT ON DELETE RESTRICT,
254
	CONSTRAINT "psprnum_fk" FOREIGN KEY ("ps_prnum")
255
		REFERENCES project ("pr_num") MATCH SIMPLE
256
		ON UPDATE RESTRICT ON DELETE RESTRICT
257
)
258
WITHOUT OIDS;
259
 
260
Create table "public"."abschluss"
261
(
262
	"ab_num" int8 Not Null,
263
	"ab_datum" Int8 Not Null,
264
	"ab_user" Int8 Not Null,
265
	"ab_prnum" Int8 Not Null,
266
	"ab_plnum" Int8 Not Null,
267
constraint "abschluss_pkey" primary key ("ab_num")
268
)
269
WITHOUT OIDS;
270
 
271
Create table "public"."tempidx"
272
(
273
	"te_num" Int8 Not Null UNIQUE,
274
	"te_name" Varchar(60) Not Null,
275
	"te_zweck" Varchar(2048),
276
constraint "pk_tempidx" primary key ("te_num")
277
)
278
WITHOUT OIDS;
279
 
280
Create table "public"."dration"
281
(
282
	"dr_num" Int8 Not Null UNIQUE,
283
	"dr_date_start" Timestamp,	-- Startdatum und Zeit der Reise.
284
	"dr_date_end" Timestamp,	-- Endedatum und Zeit der Reise.
285
	"dr_target" varchar(60),	-- Zielort / Land
286
	"dr_purpose" varchar(60),	-- Zweck der Reise
287
	"dr_pnightr" bool,		-- True = Naechtigungspauschale, False = Sonderbetrag
288
	"dr_nightr" Double precision,	-- Sonderbetrag Naechtigung(en)
289
	"dr_amount" Double precision,	-- Spesen
290
	"dr_kmcar" Smallint,		-- Gefahrene Kilometer
291
	"dr_kfzkenn" char(16),		-- KFZ Kennzeichen
292
	"dr_kmdrain" Smallint,		-- Gefahrene Kilometer
293
	"dr_pkmplain" bool,		-- True = Flugpauschale, False = Einzelpreis
294
	"dr_kmplain" Double precision,	-- Angefallene Flugkosten
295
	"dr_wdnum" Int8 Not Null,	-- Verknuepfung zu IST-Eintrag
296
	"dr_whg" Int8 Not Null,		-- Waehrung
297
	"dr_remark" varchar(4096),	-- Bemerkung / Kommentar
298
	"dr_costloc" Int8 Not Null,	-- Kostenstelle
299
	"dr_permit" Bool,		-- True = Abrechnung ist genehmigt
300
	"dr_minum" Int8,		-- Abrechnung wurde genehmigt durch <controller X>
301
constraint "pk_dration" primary key ("dr_num")
302
)
303
WITHOUT OIDS;
304
 
305
Create table "public"."charge"
306
(
307
	"ch_num" Int8 Not Null UNIQUE,
308
	"ch_date" Date Not Null,
309
	"ch_amount" Double precision Not Null,
310
	"ch_category" Int8 Not Null,
311
	"ch_costloc" Int8 Not Null,
312
	"ch_prnum" Int8 Not Null,
313
	"ch_whg" Int8 Not Null,
314
constraint "pk_charge" primary key ("ch_num")
315
)
316
WITHOUT OIDS;
317
 
318
Create table "public"."key_category"
319
(
320
	"kc_num" Int8 Not Null UNIQUE,
321
	"kc_category" Varchar(60),
322
constraint "pk_key_category" primary key ("kc_num")
323
)
324
WITHOUT OIDS;
325
 
326
Create table "public"."key_costloc"
327
(
328
	"kc_num" Int8 Not Null UNIQUE,
329
	"kc_costloc" Varchar(60),
330
constraint "pk_key_costloc" primary key ("kc_num")
331
)WITHOUT OIDS;
332
 
333
Create table "public"."kunde"
334
(
335
	"ku_num" Int8 Not Null UNIQUE,
336
	"ku_firma" Varchar(80),
337
	"ku_anrede" Integer Not Null,
338
	"ku_vname" Varchar(60),
339
	"ku_nname" Varchar(60),
340
	"ku_strasse" Varchar(60),
341
	"ku_hnum" Varchar(10),
342
	"ku_ort" Varchar(60),
343
	"ku_plz" Varchar(16),
344
	"ku_costloc" Int8 Not Null,
345
constraint "pk_kunde" primary key ("ku_num")
346
)
347
WITHOUT OIDS;
348
 
349
Create table "public"."key_anrede"
350
(
351
	"ka_num" Int8 Not Null UNIQUE,
352
	"ka_anrede" Varchar(30),
353
constraint "pk_key_anrede" primary key ("ka_num")
354
)
355
WITHOUT OIDS;
356
 
357
Create table "public"."kgroup"
358
(
359
	"kg_num" Int8 Not Null UNIQUE,
360
	"kg_name" Varchar(60) Not Null,
361
	"kg_prnum" Int8,
362
constraint "pk_kgroup" primary key ("kg_num")
363
)
364
WITHOUT OIDS;
365
 
366
Create table "public"."kgsammel"
367
(
368
	"ks_num" Int8 Not Null UNIQUE,
369
	"ks_kgnum" Int8 Not Null,
370
	"ks_kunum" Int8 Not Null,
371
constraint "pk_kgsammel" primary key ("ks_num")
372
)
373
WITHOUT OIDS;
374
 
375
Create table "public"."histanteil"
376
(
377
	"hi_num" Int8 Not Null UNIQUE,
378
	"hi_valid_from" Date Not Null,
379
	"hi_valid_to" Date,
380
	"hi_ksnum" Int8 Not Null,
381
	"hi_proz" Float8 Not Null,
382
constraint "pk_histanteil" primary key ("hi_num")
383
)
384
WITHOUT OIDS;
385
 
386
Create table "public"."fixanteil"
387
(
388
	"fx_num" Int8 Not Null UNIQUE,
389
	"fx_valid_from" Date Not Null,
390
	"fx_valid_to" Date,
391
	"fx_kunum" Int8 Not Null,
392
	"fx_proz" Float8 Not Null,
393
constraint "pk_fixanteil" primary key ("fx_num")
394
)
395
WITHOUT OIDS;
396
 
397
Create table "public"."calendar"
398
(
399
	"ca_num" Int8 Not Null UNIQUE,
400
	"ca_prnum" Int8,
401
	"ca_minum" Int8,
402
	"ca_task" Int8,
403
	"ca_writer" Int8,
404
	"ca_date" Int8 Not Null,
405
	"ca_end" Int8,
406
	"ca_repeat" smallint,
407
	"ca_repanz" smallint,
408
	"ca_title" varchar(60),
409
	"ca_text" Varchar(4096),
410
	"ca_status" smallint,
411
	"ca_priority" smallint,
412
constraint "pk_calendar" primary key ("ca_num")
413
)
414
WITHOUT OIDS;
415
 
416
Create table "public"."ejournal"
417
(
418
	"ej_num" Int8 Not Null UNIQUE,
419
	"ej_date" Int8,
420
	"ej_uid" Int8,
421
	"ej_type" Smallint,
422
	"ej_text" Varchar(4096),
423
constraint "pk_ejournal" primary key ("ej_num")
424
)
425
WITHOUT OIDS;
426
 
427
Create table "public"."key_jtype"
428
(
429
	"kj_num" Int8 Not Null UNIQUE,
430
	"kj_text" Varchar(50),
431
constraint "pk_key_jtype" primary key ("kj_num")
432
)
433
WITHOUT OIDS;
434
 
38 andreas 435
CREATE TABLE "public"."language"
4 andreas 436
(
437
  la_num int8 NOT NULL, -- Interne laufende Nummer
438
  la_tnum int4 NOT NULL, -- Manuell vergebene Nummer des Textes
439
  la_lang char(4) NOT NULL, -- ISO Sprachkuerzel
440
  la_text varchar(2048) NOT NULL, -- Beliebiger Text
441
  CONSTRAINT pk_lanum PRIMARY KEY (la_num)
442
)
443
WITHOUT OIDS;
444
 
38 andreas 445
CREATE TABLE "public"."matopr"
4 andreas 446
(
447
  ma_num int8 NOT NULL, -- Laufende Nummer
448
  ma_minum int8 NOT NULL, -- Mitarbeiternummer
449
  ma_prnum int8 NOT NULL, -- Projektnummer
450
  ma_role int8, -- Rolle im Projekt
451
  CONSTRAINT pk_manum PRIMARY KEY (ma_num),
452
  CONSTRAINT fk_minum FOREIGN KEY (ma_minum)
453
    REFERENCES mitarbeiter (mi_num) MATCH SIMPLE
454
    ON UPDATE RESTRICT ON DELETE RESTRICT,
455
  CONSTRAINT fk_prnum FOREIGN KEY (ma_prnum)
456
    REFERENCES project (pr_num) MATCH SIMPLE
457
    ON UPDATE RESTRICT ON DELETE RESTRICT,
458
  CONSTRAINT fk_role FOREIGN KEY (ma_role)
459
    REFERENCES key_role (kr_num) MATCH SIMPLE
460
    ON UPDATE RESTRICT ON DELETE RESTRICT
461
) 
462
WITHOUT OIDS;
463
 
464
/* Create Comment on Tables */
465
Comment on table "public"."allocation" is 'Enthaelt Mitarbeiter die zu einem bestimmten Task verknuepft sind';
466
Comment on table "public"."counter" is 'Beinhaltet Zaehlervariablen fuer die automatischen Zaehler einiger Tabellen und die Versionsnummer des Programms fuer das die Datenbank erzeugt wurde';
467
Comment on table "public"."wdone" is 'Erfassung der geleisteten Arbeitszeit';
468
Comment on table "public"."key_sgf" is 'Definiert die Strategischen Geschaeftsfuehrer, sofern es solche gibt.';
469
Comment on table "public"."key_abt" is 'Definiert individuelle Abteilungen. Jeder Mitarbeiter muss einer der definierten Abteilungen angehoeren.';
470
Comment on table "public"."key_role" is 'Definiert einen individuellen Schluessel fuer die Rolle eines Mitarbeiters innerhalb eines Projekts';
471
Comment on table "public"."key_tmgroup" is 'Definiert individuelle Themenmanagergruppen, mit deren Hilfe die Projekte in Themengruppen gebuendelt werden koennen.';
472
Comment on table "public"."key_land" is 'Definiert einen individuellen Laenderschluessel';
473
Comment on table "public"."ptemp" is 'Beinhaltet Templates zur Erzeugung eines Plans';
474
Comment on table "public"."project" is 'Beinhaltet die Grunddefinition eines Projekts.';
475
Comment on table "public"."mitarbeiter" is 'Enthaelt die Daten eines Mitarbeiters';
476
Comment on table "public"."key_phase" is 'Definiert einen individuellen Schluessel fuer die einzelnen Phasen eines Projekts';
477
Comment on table "public"."plan" is 'Beinhaltet die Grunddaten eines Projektplans';
478
Comment on table "public"."dration" is 'Enthaelt die Betraege in Form einer Historie, welche den Mitarbeitern verrechnet werden, wenn Reisekosten anfallen.';
479
Comment on table "public"."charge" is 'Ordnet einem Projekt finanzielle Aufschlaege und/oder Belastungen zu, welche keine Standardkosten wie Reisekosten sind.';
480
Comment on table "public"."key_category" is 'Definiert Kategorien in die angefallene Aufwaende eingeteilt werden koennen';
481
Comment on table "public"."key_costloc" is 'Definiert Kostenstellen zu denen ein Kunde (und Projekt) zugeordnet werden kann.';
482
Comment on table "public"."kunde" is 'Enthaelt die Daten von externen Kunden, welche die Auftraggeber sind';
483
Comment on table "public"."key_anrede" is 'Definiert Schluessel die eine Anredeform definieren';
484
Comment on table "public"."kgroup" is 'Definiert eine Gruppe von Kunden. Alle Gruppenmitglieder koennen einen prozentuellen Anteil an der Umsetzung eines Projekts haben, was sich auf die Erstellung der Rechnung entsprechend auswirkt.';
485
Comment on table "public"."histanteil" is 'Fasst mehrere Anteile zusammen. Dadurch kann eine historie gebildet werden. Das ist notwendig da sich die Anteilsverhaeltnisse jederzeit aendern koennen und eine Historie benoetigt wird um die Projektkosten korrekt ermitteln zu koennen.';
486
Comment on table "public"."calendar" is 'Enthaelt die Kalendereintraege von Tasks und Ereignissen fuer jeden einzelnen Mitarbeiter';
487
Comment on table "public"."ejournal" is 'Enthaelt ein elektrisches Journal ueber die Vorgaenge innerhalb der Applikation';
488
Comment on table "public"."key_jtype" is 'Schluesseltabelle der Journaltypen (loeschen, aendern, etc)';
489
Comment on table "public"."abschluss" is 'Enthaelt die Datum an denen in den einzelnen Projekten bestimmte Zeitbereiche als Abgeschlossen markiert wurden. In diesen Zeitbereichen kann keine IST-Erfassung erfolgen.';
490
Comment on table "public"."planstatus" IS 'Enthaelt den Statusbericht zu einem Plan.';
491
Comment on table "public"."kgsammel" is 'Dient als Kontainer fuer mehrere Kunden.';
492
COMMENT ON TABLE "public"."key_whg" IS 'Waehrungsschluessel';
493
COMMENT ON TABLE "public"."tagsatz" IS 'Beinhaltet die Tagsaetze zu jedem einzelnen Mitarbeiter';
494
COMMENT ON TABLE "public"."language" IS 'Beinhaltet alle Textausgaben in verschiedenen Sprachen';
495
COMMENT ON TABLE "public"."matopr" IS 'Mitarbeiter zu Projekt; Ordnet einen oder mehrere Mitarbeiter einem Projekt zu und definiert deren Rolle im Projekt.';
496
 
497
/* Create Comment on Columns */
498
Comment on column "public"."allocation"."al_num" is 'Automatisch generierte Nummer';
499
Comment on column "public"."allocation"."al_task" is 'Task zu dem der Mitarbeiter verknuepft ist; Verknuepft mit task';
500
Comment on column "public"."allocation"."al_ressource" is 'Mitarbeiter; Verknuepft mit mitarbeiter';
501
Comment on column "public"."allocation"."al_hours" is 'Anzahl geplante Einheiten';
502
Comment on column "public"."allocation"."al_role" is 'Rolle des Mitarbeiters im Projekt; Verknuepft zu key_role';
503
Comment on column "public"."allocation"."al_phase" is 'Phase; Verknuepft zu key_phase';
504
Comment on column "public"."allocation"."al_pstart" is 'Startdatum (Periode) fuer die die geplante Zeit gilt';
505
Comment on column "public"."allocation"."al_pduration" is 'Dauer der Periode zum Planungszeitpunkt (nicht in Verwendung!)';
506
Comment on column "public"."counter"."co_mitarbeiter" is 'Zaehler fuer Tabelle mitarbeiter';
507
Comment on column "public"."counter"."co_plan" is 'Zaehler fuer Tabelle plan';
508
Comment on column "public"."counter"."co_task" is 'Zaehler fuer Tabelle task';
509
Comment on column "public"."counter"."co_wdone" is 'Zaehler fuer Tabelle wdone';
510
Comment on column "public"."counter"."co_allocation" is 'Zaehler fuer Tabelle allocation';
511
Comment on column "public"."counter"."co_ptemp" is 'Zaehler fuer Tabelle ptemp';
512
Comment on column "public"."counter"."co_tempidx" is 'Zaehler fuer Tabelle tempidx';
513
Comment on column "public"."counter"."co_charge" is 'Zaehler fuer Tabelle charge';
514
Comment on column "public"."counter"."co_kgroup" is 'Zaehler fuer Tabelle kgroup';
515
Comment on column "public"."counter"."co_kunde" is 'Zaehler fuer Tabelle kunde';
516
Comment on column "public"."counter"."co_histanteil" is 'Zaehler fuer Tabelle histanteil';
517
Comment on column "public"."counter"."version" is 'Versionsnummer des Programms und damit auch der Datenbank. Beide Versionsnummern muessen zusammenpassen, damit das Programm korrekt funktioniert.';
518
Comment on column "public"."counter"."co_calendar" is 'Zaehler fuer Tabelle calendar';
519
Comment on column "public"."counter"."co_ejournal" is 'Zaehler fuer Tabelle ejournal';
520
Comment on column "public"."wdone"."wd_num" is 'Automatisch generierte Nummer';
521
Comment on column "public"."wdone"."wd_prnum" is 'Projektnummer; Verknuepfung zu projekt';
522
Comment on column "public"."wdone"."wd_minum" is 'Mitarbeiter; Verknuepfung zu mitarbeiter';
523
Comment on column "public"."wdone"."wd_datum" is 'Datum fuer das die Zeiterfassung gilt';
524
Comment on column "public"."wdone"."wd_hours" is 'Anzahl gearbeitete Stunden';
525
Comment on column "public"."wdone"."wd_task" is 'Tast; Verknuepfung zu task';
526
Comment on column "public"."wdone"."wd_rk" is '1 = Reisekosten angefallen; 0 = keine Reisekosten';
527
Comment on column "public"."wdone"."wd_phase" is 'Phase; Verknuepfung zu key_phase';
528
Comment on column "public"."wdone"."wd_edit" is '0 = Datensatz ist editierbar; 1 = Datensatz ist gesperrt';
529
Comment on column "public"."wdone"."wd_text" is 'Beschreibung der erledigten Arbeit';
530
Comment on column "public"."wdone"."wd_verr" is '0 = IST-Zeit ist verrechenbar; 1 = IST-Zeit ist nicht verrechenbar';
531
Comment on column "public"."key_sgf"."ks_num" is 'Schluesselnummer';
532
Comment on column "public"."key_sgf"."ks_sgf" is 'Strategisches Geschaeftsfeld';
533
Comment on column "public"."key_abt"."ka_num" is 'Schluesselnummer';
534
Comment on column "public"."key_abt"."ka_abt" is 'Bezeichnung der Abteilung';
535
Comment on column "public"."key_role"."kr_num" is 'Schluesselnummer';
536
Comment on column "public"."key_role"."kr_role" is 'Rollenbezeichnung';
537
Comment on column "public"."key_tmgroup"."kt_num" is 'Schluesselnummer';
538
Comment on column "public"."key_tmgroup"."kt_tm" is 'Themenmanagergruppe';
539
Comment on column "public"."key_land"."kl_num" is 'Schluesselnummer';
540
Comment on column "public"."key_land"."kl_land" is 'Land, Herkunft';
541
Comment on column "public"."task"."ta_num" is 'Automatisch vergebene Tasknummer';
542
Comment on column "public"."task"."ta_plnum" is 'Plannummer; Verknuepfung zu plan';
543
Comment on column "public"."task"."ta_id" is 'Automatisch generierte laufende Nummer innerhalb eines Plans';
544
Comment on column "public"."task"."ta_depend" is 'Definiert die Abhaengigkeit eines Tasks von einem anderen. Der Inhalt dieser Variablen referenziert auf die Tabelle task innerhalb des selben Plans';
545
Comment on column "public"."task"."ta_deptype" is 'Schluessel fuer die Art der Abhaengigkeit. Der Schluessel bezieht sich auf das Feld ta_deptype';
546
Comment on column "public"."task"."ta_name" is 'Name des Tasks';
547
Comment on column "public"."task"."ta_color" is 'Farbe des Tasks in R G B 32 Bit kodiert';
548
Comment on column "public"."task"."ta_shape" is 'Darzustellendes Muster';
549
Comment on column "public"."task"."ta_meeting" is '1 = Meilenstein; 0 = Normaler Task';
550
Comment on column "public"."task"."ta_start" is 'Startdatum des Tasks in Sekunden seit 1.1.1970';
551
Comment on column "public"."task"."ta_duration" is 'Dauer des Tasks in "Einheiten"';
552
Comment on column "public"."task"."ta_complete" is 'Prozentueller Teil des asks der bereits erledigt ist.';
553
Comment on column "public"."task"."ta_priority" is 'Prioritaet des Tasks';
554
Comment on column "public"."task"."ta_level" is 'Grad der Einrueckung bei optischer Darstellung';
555
Comment on column "public"."task"."ta_notiz" is 'Kommentar zum Task';
556
Comment on column "public"."task"."ta_phase" is 'Phase; Verweis auf key_phase';
557
Comment on column "public"."task"."ta_risiko" is 'Definiert das Risiko fuer die Umsetzung des Tasks in Prozent';
558
Comment on column "public"."task"."ta_hash" is 'Hashwert des Inhalts von ta_name';
559
Comment on column "public"."task"."ta_notiz" is 'Optionaler Kommentar';
560
Comment on column "public"."ptemp"."pt_num" is 'Automatisch generierte interne laufende Nummer';
561
Comment on column "public"."ptemp"."pt_tnum" is 'Verknuepfung zur internen Plannummer';
562
Comment on column "public"."ptemp"."pt_lfd" is 'Laufende Nummer innerhalb eines Plans (Taskreihenfolge)';
563
Comment on column "public"."ptemp"."pt_level" is 'Grad der Einrueckung';
564
Comment on column "public"."ptemp"."pt_name" is 'Taskname';
565
Comment on column "public"."ptemp"."pt_color" is 'Farbe';
566
Comment on column "public"."ptemp"."pt_meeting" is 'True = Meilenstein; False = Task';
567
Comment on column "public"."ptemp"."pt_phase" is 'Phase (optional)';
568
Comment on column "public"."project"."pr_num" is 'Projektnummer.';
569
Comment on column "public"."project"."pr_name" is 'Projektname';
570
Comment on column "public"."project"."pr_pl" is 'Projektleiter; Verknuepfung zu Mitarbeiter';
571
Comment on column "public"."project"."pr_plav" is 'Projektlenkungsausschuss Vorsitzender; Verknuepfung zu Mitarbeiter';
572
Comment on column "public"."project"."pr_sgf" is 'Strategisches Geschaeftsfeld; Verknuepfung zu key_sgf';
573
Comment on column "public"."project"."pr_tmgroup" is 'Themenmanagergruppe; Verknuepfung zu key_tmgroup';
574
Comment on column "public"."project"."pr_status" is 'Projektart';
575
Comment on column "public"."mitarbeiter"."mi_num" is 'Automatisch generierte Nummer';
576
Comment on column "public"."mitarbeiter"."mi_vname" is 'Vorname';
577
Comment on column "public"."mitarbeiter"."mi_nname" is 'Nachname';
578
Comment on column "public"."mitarbeiter"."mi_land" is 'Land; Verknuepfung zu key_land';
579
Comment on column "public"."mitarbeiter"."mi_abt" is 'Abteilung; Verlnuepfung zu key_abt';
580
Comment on column "public"."mitarbeiter"."mi_tel" is 'Telefonnummer / Klappe';
581
Comment on column "public"."mitarbeiter"."mi_mail" is 'E-Mailadresse';
582
Comment on column "public"."mitarbeiter"."mi_userid" is 'UserID; Dient zum Anmelden an das Programm und muss daher eindeutig sein.';
583
Comment on column "public"."mitarbeiter"."mi_passwd" is 'Passwort';
584
Comment on column "public"."mitarbeiter"."mi_rstufe" is 'Berechtigungsstufe';
585
Comment on column "public"."mitarbeiter"."mi_hacker" is 'Hackerkennzeichen';
586
Comment on column "public"."mitarbeiter"."mi_plan" is 'Mitarbeiter ist planbar (true), oder nicht (false)';
587
Comment on column "public"."key_phase"."kp_num" is 'Schluesselnummer';
588
Comment on column "public"."key_phase"."kp_phase" is 'Phasenname';
589
Comment on column "public"."plan"."pl_num" is 'Automatisch vergebene Plannummer';
590
Comment on column "public"."plan"."pl_lfd" is 'Automatisch generierte Laufende Nummer innerhalb eines Plans';
591
Comment on column "public"."plan"."pl_prnum" is 'Projektnummer; Verknuepfung zu projekt';
592
Comment on column "public"."plan"."pl_status" is 'Status des Plans';
593
Comment on column "public"."tempidx"."te_num" is 'Automatisch generierter interner Schluessel';
594
Comment on column "public"."tempidx"."te_name" is 'Name des Templates';
595
Comment on column "public"."tempidx"."te_zweck" is 'Kurze Beschreibung des Zwecks des Templates';
596
Comment on column "public"."dration"."dr_num" is 'Automatisch generierte interne laufende Nummer';
597
Comment on column "public"."dration"."dr_date_start" is 'Datum gueltig von. Notwendig um eine Historie auftzubauen';
598
Comment on column "public"."dration"."dr_date_end" is 'Datum gueltig bis.';
599
Comment on column "public"."dration"."dr_target" is 'Reiseziel';
600
Comment on column "public"."dration"."dr_purpose" is 'Zeweck der Reise';
601
Comment on column "public"."dration"."dr_pnightr" is 'True = Pauschale Naechtigungskosten';
602
Comment on column "public"."dration"."dr_nightr" is 'Naechtigungspauschale';
603
Comment on column "public"."dration"."dr_amount" is 'Angefallene Spesen';
604
Comment on column "public"."dration"."dr_kmcar" is 'Gefahrene Kilometer mit dem PKW';
605
Comment on column "public"."dration"."dr_kmdrain" is 'Gefahrene Kilometer mit Bahn / Bus';
606
Comment on column "public"."dration"."dr_pkmplain" is 'True = pauschale Flugkosten';
607
Comment on column "public"."dration"."dr_kmplain" is 'Angefallene Flugkosten';
608
Comment on column "public"."dration"."dr_wdnum" is 'Verknuepfung zu einer IST-Erfassung. Die Verknuepfung erfolgt nur wenn Reisekosten anfallen!';
609
Comment on column "public"."dration"."dr_whg" is 'Waehrung';
610
Comment on column "public"."dration"."dr_remark" is 'Anmerkungen zur Reisekostenabrechnung';
611
Comment on column "public"."dration"."dr_costloc" is 'Kostenstelle';
612
Comment on column "public"."dration"."dr_permit" is 'True = Reisekosten wurden genehmigt';
613
Comment on column "public"."dration"."dr_minum" is 'Reisekosten wurden von X genehmigt';
614
Comment on column "public"."charge"."ch_num" is 'Automatisch generierte laufende interne Nummer';
615
Comment on column "public"."charge"."ch_date" is 'Datum an dem der Aufwand angefallen ist.';
616
Comment on column "public"."charge"."ch_amount" is 'Betrag / Hoehe des Aufwands';
617
Comment on column "public"."charge"."ch_category" is 'Kategorie';
618
Comment on column "public"."charge"."ch_costloc" is 'Kostenstelle';
619
Comment on column "public"."charge"."ch_prnum" is 'Projektnummer';
620
Comment on column "public"."charge"."ch_whg" is 'Waehrung';
621
Comment on column "public"."key_category"."kc_num" is 'Schluesselnummer';
622
Comment on column "public"."key_category"."kc_category" is 'Bezeichnung der Kategorie eines angefallenen Aufwands';
623
Comment on column "public"."key_costloc"."kc_num" is 'Kostenstelle';
624
Comment on column "public"."key_costloc"."kc_costloc" is 'Bezeichnung der Kostenstelle';
625
Comment on column "public"."kunde"."ku_num" is 'Kundennummer';
626
Comment on column "public"."kunde"."ku_firma" is 'Name der Firma';
627
Comment on column "public"."kunde"."ku_anrede" is 'Anrede des Kunden';
628
Comment on column "public"."kunde"."ku_vname" is 'Vorname des Kunden (optional)';
629
Comment on column "public"."kunde"."ku_nname" is 'Nachname des Kunden (optional)';
630
Comment on column "public"."kunde"."ku_strasse" is 'Firmenanschrift; Strasse';
631
Comment on column "public"."kunde"."ku_hnum" is 'Firmenanschrift; Hausnummer';
632
Comment on column "public"."kunde"."ku_ort" is 'Firmenanschrift; Ort';
633
Comment on column "public"."kunde"."ku_plz" is 'Firmenanschrift; Postleitzahl';
634
Comment on column "public"."kunde"."ku_costloc" is 'Kostenstelle';
635
Comment on column "public"."key_anrede"."ka_num" is 'Schluesselnummer';
636
Comment on column "public"."key_anrede"."ka_anrede" is 'Anrede des Kunden';
637
Comment on column "public"."kgroup"."kg_num" is 'Automatisch generierte interne laufende Nummer';
638
Comment on column "public"."kgroup"."kg_name" is 'Gruppenname';
639
Comment on column "public"."kgroup"."kg_prnum" is 'Projektnummer';
640
Comment on column "public"."histanteil"."hi_num" is 'Automatisch generierte interne laufende Nummer';
641
Comment on column "public"."histanteil"."hi_valid_from" is 'Datum ab dem der Eintrag gilt.';
642
Comment on column "public"."histanteil"."hi_valid_to" is 'Datum bis zu dem der Eintrag gilt.';
643
Comment on column "public"."histanteil"."hi_ksnum" is 'Kontainernummer';
644
Comment on column "public"."histanteil"."hi_proz" is 'Anteile in Prozent';
645
Comment on column "public"."fixanteil"."fx_num" is 'Automatisch generierte interne laufende Nummer';
646
Comment on column "public"."fixanteil"."fx_valid_from" is 'Datum ab dem der Eintrag gilt.';
647
Comment on column "public"."fixanteil"."fx_valid_to" is 'Datum bis zu dem der Eintrag gilt.';
648
Comment on column "public"."fixanteil"."fx_kunum" is 'Kundennummer';
649
Comment on column "public"."fixanteil"."fx_proz" is 'Anteile in Prozent';
650
Comment on Column "public"."calendar"."ca_num" is 'Laufende Nummer';
651
Comment on Column "public"."calendar"."ca_prnum" is 'Projektnummer';
652
Comment on column "public"."calendar"."ca_minum" is 'Mitarbeiternummer';
653
Comment on column "public"."calendar"."ca_task" is 'Tasknummer zu der die Aufgabe gehoert';
654
Comment on column "public"."calendar"."ca_writer" is 'Mitarbeiternummer des Erstellers des Eintrags';
655
Comment on column "public"."calendar"."ca_date" is 'Datum (und Uhrzeit) des Events/Tasks';
656
Comment on column "public"."calendar"."ca_end" is 'Datum des Endes der Aufgabe';
657
Comment on column "public"."calendar"."ca_repeat" is 'Art der Widerholung';
658
Comment on column "public"."calendar"."ca_repanz" is 'Anzahl der Widerholungen';
659
Comment on column "public"."calendar"."ca_title" is 'Titel / Ueberschrift des Eintrags';
660
Comment on column "public"."calendar"."ca_text" is 'Beschreibung der Aufgabe/Ereignis';
661
Comment on column "public"."calendar"."ca_status" is 'Status der Aufgabe/Ereignis';
662
Comment on column "public"."ejournal"."ej_num" is 'Laufende Nummer';
663
Comment on column "public"."ejournal"."ej_date" is 'Datum und Uhrzeit der Eintragung';
664
Comment on Column "public"."ejournal"."ej_uid" is 'UserID des aktuell angemeldeten Users, welcher die Aktion ausgeloest hat';
665
Comment on column "public"."ejournal"."ej_type" is 'Art des Eintrags';
666
Comment on column "public"."ejournal"."ej_text" is 'Beschreibung des Ereignisses';
667
Comment on column "public"."key_jtype"."kj_num" is 'Schluesselnummer des EJ-Ereignisses';
668
Comment on column "public"."key_jtype"."kj_text" is 'Schluessel in Klartext';
669
Comment on column "public"."abschluss"."ab_num" is 'Interne laufende Nummer';
670
Comment on column "public"."abschluss"."ab_datum" is 'IST-Buchungen bis zu diesem Datum wurden abgeschlossen.';
671
Comment on column "public"."abschluss"."ab_user" is 'Abschluss wurde duchgefuehrt von $USER';
672
Comment on column "public"."abschluss"."ab_prnum" is 'Projektnummer';
673
Comment on column "public"."abschluss"."ab_plnum" is 'Plannummer';
674
COMMENT ON COLUMN "public"."planstatus"."ps_num" IS 'Laufende Nummer';
675
COMMENT ON COLUMN "public"."planstatus"."ps_pl" IS 'Projektleiter';
676
COMMENT ON COLUMN "public"."planstatus"."ps_prnum" IS 'Projektnummer';
677
COMMENT ON COLUMN "public"."planstatus"."ps_plnum" IS 'Verweis auf Plan';
678
COMMENT ON COLUMN "public"."planstatus"."ps_status" IS 'true = Status ist gueltig, false = Status ist ungueltig';
679
COMMENT ON COLUMN "public"."planstatus"."ps_comment" IS 'Kommentar oder Bericht';
680
COMMENT ON COLUMN "public"."planstatus"."ps_datum" IS 'Zeitstempel der Erfassung';
681
COMMENT ON COLUMN "public"."planstatus"."ps_lfd" IS 'Laufende Nummer innerhalb eines Plans';
682
COMMENT ON COLUMN "public"."kgsammel"."ks_num" IS 'Interne laufende Nummer';
683
COMMENT ON COLUMN "public"."kgsammel"."ks_kgnum" IS 'Verknuepfung zur Kundengruppe';
684
COMMENT ON COLUMN "public"."kgsammel"."ks_kunum" IS 'Verknuepfung zum Kunden';
685
COMMENT ON COLUMN "public"."key_whg"."wh_num" IS 'ISO-Code der Waehrung';
686
COMMENT ON COLUMN "public"."key_whg"."wh_whg" IS 'Waehrungskuerzel';
687
COMMENT ON COLUMN "public"."key_whg"."wh_bez" IS 'Bezeichnung der Waehrung';
688
COMMENT ON COLUMN "public"."tagsatz"."tg_num" IS 'Interne laufende Nummer';
689
COMMENT ON COLUMN "public"."tagsatz"."tg_valid_from" IS 'Datum gueltig ab';
690
COMMENT ON COLUMN "public"."tagsatz"."tg_valid_to" IS 'Datum gueltig bis';
691
COMMENT ON COLUMN "public"."tagsatz"."tg_amount" IS 'Tagsatz';
692
COMMENT ON COLUMN "public"."tagsatz"."tg_nightr" IS 'Naechtigungspauschale';
693
COMMENT ON COLUMN "public"."tagsatz"."tg_ration" IS 'Tagesdiaeten';
694
COMMENT ON COLUMN "public"."tagsatz"."tg_kmcar" IS 'Kilometerpauschale PKW';
695
COMMENT ON COLUMN "public"."tagsatz"."tg_kmdrain" IS 'Kilometerpauschale Zug';
696
COMMENT ON COLUMN "public"."tagsatz"."tg_kmplain" IS 'Kilometerpauschale Flugzeug';
697
COMMENT ON COLUMN "public"."tagsatz"."tg_whg" IS 'Verknuepfung zur Waehrung';
698
COMMENT ON COLUMN "public"."tagsatz"."tg_minum" IS 'Verknuepfung zum Mitarbeiter';
699
COMMENT ON COLUMN "public"."language"."la_num" IS 'Interne laufende Nummer';
700
COMMENT ON COLUMN "public"."language"."la_tnum" IS 'Manuell vergebene Nummer des Textes';
701
COMMENT ON COLUMN "public"."language"."la_lang" IS 'ISO Sprachkuerzel';
702
COMMENT ON COLUMN "public"."language"."la_text" IS 'Beliebiger Text';
703
COMMENT ON COLUMN "public"."matopr"."ma_num" IS 'Laufende Nummer';
704
COMMENT ON COLUMN "public"."matopr"."ma_minum" IS 'Mitarbeiternummer';
705
COMMENT ON COLUMN "public"."matopr"."ma_prnum" IS 'Projektnummer';
706
COMMENT ON COLUMN "public"."matopr"."ma_role" IS 'Rolle im Projekt';
707
 
708
/* Create Tab 'Others' for Selected Tables */
709
 
710
 
711
 
712
 
713
/* Create Alternate Keys */
714
 
715
Create unique index "idx_ptemp_numlfd" on "public"."ptemp" ("pt_tnum","pt_lfd");
716
 
717
 
718
Create unique index "idx_mi_name" on "public"."mitarbeiter" ("mi_nname","mi_vname");
719
 
720
 
721
 
722
/* Create Indexes */
723
Create unique index "idx_mi_userid" on "public"."mitarbeiter" using btree ("mi_userid");
724
Create unique index "idx_tempidx_name" on "tempidx" using btree ("te_name");
725
Create index "idx_ejournal_date" on "ejournal" using btree ("ej_date");
726
CREATE UNIQUE INDEX "idx_text" ON "public"."language" USING btree ("la_tnum", "la_lang");
727
 
728
/* Create Foreign Keys */
729
Create index "IX_Relationship41" on "public"."dration" ("dr_wdnum");
730
Alter table "public"."dration" add Constraint "Relationship41" foreign key ("dr_wdnum") references "public"."wdone" ("wd_num") on update restrict on delete restrict;
731
Create index "IX_Relationship42" on "public"."dration" ("dr_whg");
732
Alter table "public"."dration" add Constraint "Relationship42" foreign key ("dr_whg") references "public"."key_whg" ("wh_num") on update restrict on delete restrict;
733
Create index "IX_Relationship5" on "public"."project" ("pr_sgf");
734
Alter table "public"."project" add Constraint "Relationship5" foreign key ("pr_sgf") references "public"."key_sgf" ("ks_num") on update restrict on delete restrict;
735
Create index "IX_Relationship10" on "public"."mitarbeiter" ("mi_abt");
736
Alter table "public"."mitarbeiter" add Constraint "Relationship10" foreign key ("mi_abt") references "public"."key_abt" ("ka_num") on update restrict on delete restrict;
737
Create index "IX_Relationship17" on "public"."allocation" ("al_role");
738
Alter table "public"."allocation" add Constraint "Relationship17" foreign key ("al_role") references "public"."key_role" ("kr_num") on update restrict on delete restrict;
739
Create index "IX_Relationship4" on "public"."project" ("pr_tmgroup");
740
Alter table "public"."project" add Constraint "Relationship4" foreign key ("pr_tmgroup") references "public"."key_tmgroup" ("kt_num") on update restrict on delete restrict;
741
Create index "IX_Relationship11" on "public"."mitarbeiter" ("mi_land");
742
Alter table "public"."mitarbeiter" add Constraint "Relationship11" foreign key ("mi_land") references "public"."key_land" ("kl_num") on update restrict on delete restrict;
743
Create index "IX_Relationship13" on "public"."allocation" ("al_task");
744
Alter table "public"."allocation" add Constraint "Relationship13" foreign key ("al_task") references "public"."task" ("ta_num") on update restrict on delete restrict;
745
Create index "IX_Relationship21" on "public"."wdone" ("wd_task");
746
Alter table "public"."wdone" add Constraint "Relationship21" foreign key ("wd_task") references "public"."task" ("ta_num") on update restrict on delete restrict;
747
Create index "IX_R12" on "public"."plan" ("pl_prnum");
748
Alter table "public"."plan" add Constraint "R12" foreign key ("pl_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
749
Create index "IX_Relationship6" on "public"."wdone" ("wd_prnum");
750
Alter table "public"."wdone" add Constraint "Relationship6" foreign key ("wd_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
751
Create index "IX_Relationship38" on "public"."charge" ("ch_prnum");
752
Alter table "charge" add Constraint "Relationship38" foreign key ("ch_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
753
Create index "IX_Relationship39" on "public"."charge" ("ch_whg");
754
Alter table "charge" add Constraint "Relationship39" foreign key ("ch_whg") references "public"."key_whg" ("wh_num") on update restrict on delete restrict;
755
Create index "IX_Relationship40" on "public"."kgroup" ("kg_prnum");
756
Alter table "kgroup" add Constraint "Relationship40" foreign key ("kg_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
757
Create index "IX_Relationship7" on "public"."wdone" ("wd_minum");
758
Alter table "public"."wdone" add Constraint "Relationship7" foreign key ("wd_minum") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
759
Create index "IX_Relationship15" on "public"."allocation" ("al_ressource");
760
Alter table "public"."allocation" add Constraint "Relationship15" foreign key ("al_ressource") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
761
Create index "IX_Relationship19" on "public"."project" ("pr_pl");
762
Alter table "public"."project" add Constraint "Relationship19" foreign key ("pr_pl") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
763
Create index "IX_Relationship20" on "public"."project" ("pr_plav");
764
Alter table "public"."project" add Constraint "Relationship20" foreign key ("pr_plav") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
765
Create index "IX_Relationship9" on "public"."task" ("ta_phase");
766
Alter table "public"."task" add Constraint "Relationship9" foreign key ("ta_phase") references "public"."key_phase" ("kp_num") on update restrict on delete restrict;
767
Create index "IX_Relationship12" on "public"."wdone" ("wd_phase");
768
Alter table "public"."wdone" add Constraint "Relationship12" foreign key ("wd_phase") references "public"."key_phase" ("kp_num") on update restrict on delete restrict;
769
Create index "IX_Relationship16" on "public"."allocation" ("al_phase");
770
Alter table "public"."allocation" add Constraint "Relationship16" foreign key ("al_phase") references "public"."key_phase" ("kp_num") on update restrict on delete restrict;
771
Create index "IX_Relationship18" on "public"."ptemp" ("pt_phase");
772
Alter table "public"."ptemp" add Constraint "Relationship18" foreign key ("pt_phase") references "public"."key_phase" ("kp_num") on update restrict on delete restrict;
773
Create index "IX_Relationship8" on "public"."task" ("ta_plnum");
774
Alter table "public"."task" add Constraint "Relationship8" foreign key ("ta_plnum") references "public"."plan" ("pl_num") on update restrict on delete restrict;
775
Create index "IX_Relationship22" on "ptemp" ("pt_tnum");
776
Alter table "public"."ptemp" add Constraint "Relationship22" foreign key ("pt_tnum") references "tempidx" ("te_num") on update restrict on delete restrict;
777
Create index "IX_Relationship23" on "charge" ("ch_category");
778
Alter table "public"."charge" add Constraint "Relationship23" foreign key ("ch_category") references "key_category" ("kc_num") on update restrict on delete restrict;
779
Create index "IX_Relationship24" on "charge" ("ch_costloc");
780
Alter table "public"."charge" add Constraint "Relationship24" foreign key ("ch_costloc") references "key_costloc" ("kc_num") on update restrict on delete restrict;
781
Create index "IX_Relationship26" on "kunde" ("ku_costloc");
782
Alter table "public"."kunde" add Constraint "Relationship26" foreign key ("ku_costloc") references "key_costloc" ("kc_num") on update restrict on delete restrict;
783
Create index "IX_Relationship31" on "histanteil" ("hi_ksnum");
784
Alter table "public"."histanteil" add Constraint "Relationship31" foreign key ("hi_ksnum") references "kgsammel" ("ks_num") on update restrict on delete restrict;
785
Create index "IX_Relationship32" on "fixanteil" ("fx_kunum");
786
Alter table "public"."fixanteil" add Constraint "Relationship32" foreign key ("fx_kunum") references "kunde" ("ku_num") on update restrict on delete restrict;
787
Create index "IX_Relationship25" on "kunde" ("ku_anrede");
788
Alter table "public"."kunde" add Constraint "Relationship25" foreign key ("ku_anrede") references "key_anrede" ("ka_num") on update restrict on delete restrict;
789
Create index "IX_Relationship50" on "public"."calendar" ("ca_prnum");
790
Alter table "public"."calendar" add Constraint "Relationship50" foreign key ("ca_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
791
Create index "IX_Relationship51" on "public"."calendar" ("ca_minum");
792
Alter table "public"."calendar" add Constraint "Relationship51" foreign key ("ca_minum") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
793
Create index "IX_Relationship52" on "public"."calendar" ("ca_task");
794
Alter table "public"."calendar" add Constraint "Relationship52" foreign key ("ca_task") references "public"."task" ("ta_num") on update restrict on delete restrict;
795
Create index "IX_Relationship53" on "public"."calendar" ("ca_writer");
796
Alter table "public"."calendar" add Constraint "Relationship53" foreign key ("ca_writer") references "public"."mitarbeiter" ("mi_num") on update restrict on delete restrict;
797
Create index "IX_Relationship54" on "public"."ejournal" ("ej_type");
798
Alter table "public"."ejournal" add Constraint "Relationship54" foreign key ("ej_type") references "public"."key_jtype" ("kj_num") on update restrict on delete restrict;
799
Create index "IX_Relationship55" on "public"."abschluss" ("ab_prnum");
800
Alter table "public"."abschluss" add Constraint "Relationship55" foreign key ("ab_prnum") references "public"."project" ("pr_num") on update restrict on delete restrict;
801
Create index "IX_Relationship56" on "public"."abschluss" ("ab_plnum");
802
Alter table "public"."abschluss" add Constraint "Relationship56" foreign key ("ab_plnum") references "public"."plan" ("pl_num") on update restrict on delete restrict;
803
Create index "IX_Relationship57" on "public"."kgsammel" ("ks_kunum");
804
Alter table "public"."kgsammel" add Constraint "Relationship57" foreign key ("ks_kunum") references "public"."kunde" ("ku_num") on update restrict on delete restrict;
805
Create index "IX_Relationship58" on "public"."kgsammel" ("ks_kgnum");
806
Alter table "public"."kgsammel" add Constraint "Relationship58" foreign key ("ks_kgnum") references "public"."kgroup" ("kg_num") on update restrict on delete restrict;
807
 
808
/* Create Views */
809
/* created on 14.10.2004 13:56:56 */
810
 
811
create view allocmi as
812
select allocation.al_num as am_num,
813
allocation.al_task as am_task,
814
allocation.al_ressource as am_ressource,
815
allocation.al_hours as am_hours,
816
allocation.al_phase as am_phase,
817
key_role.kr_role as am_role,
818
key_role.kr_num as am_krnum,
819
mitarbeiter.mi_vname as am_vname,
820
mitarbeiter.mi_nname as am_nname,
821
allocation.al_pstart as am_pstart,
822
allocation.al_pduration as am_pduration
823
from allocation left join mitarbeiter on mitarbeiter.mi_num = allocation.al_ressource
824
     left join key_role on key_role.kr_num = allocation.al_role;
825
 
826
 
827
 
828
/* Create Referential Integrity Triggers */
829
 
830
 
831
 
832
 
833
 
834
/* Create User-Defined Triggers */
835
 
836
 
837
 
838
 
839
/* Insert some basic values into the key tables */
840
 
841
 
842
COPY "counter" FROM stdin;
38 andreas 843
 
4 andreas 844
\.
845
 
846
 
847
COPY "key_jtype" FROM stdin;
38 andreas 848
100	Task Gelöscht
849
101	Plan gelöscht
850
102	Projekt gelöscht
851
103	IST-Eintrag gelöscht
852
104	Kalendereintrag gelöscht
853
105	Mitarbeiter aus Plan gelöscht
4 andreas 854
200	Plan kopiert
38 andreas 855
201	Neuen Mitarbeiter hinzugefögt
856
202	Mitarbeiter in Plan hinzugefügt
857
204	Neuen Plan für Konto angelegt
858
205	Neuen Plan hinzugefügt
859
300	Plan geändert
860
301	Projekt geändert
861
302	IST-Eintrag geändert
862
303	Mirarbeiter geändert
863
304	Kalendereintrag geändert
4 andreas 864
999	Unbekannter Eintrag
865
\.
866
 
867
copy "key_whg" from stdin;
868
1	USD	US-Dollar
38 andreas 869
2	EGP	Ägyptisches Pfund
870
3	ETB	Äthiopischer Birr
871
4	ATS	Österreichischer Schilling
4 andreas 872
5	AFN	Afghanischer Afghani
873
6	ALL	Albanischer Lek
874
7	DZD	Algerischer Dinar
875
8	ADP	Andorranische Pesete
876
9	ADF	Andorranischer Franc
877
10	AON	Angolanischer Kwanza
878
11	ARS	Argentinischer Peso
879
12	AWG	Aruba-Florin
880
13	AUD	Australischer Dollar
881
14	BSD	Bahama-Dollar
882
15	BHD	Bahrain-Dinar
883
16	BDT	Bangladeschischer Taka
884
17	BBD	Barbados-Dollar
885
18	BEF	Belgischer Franc
886
19	BZD	Belize-Dollar
887
20	BMD	Bermuda-Dollar
888
21	BTN	Bhutanischer Ngultrum
889
22	BOB	Bolivianischer Boliviano
890
23	BWP	Botsuanischer Pula
891
24	BRL	Brasilianischer Real
892
25	GBP	Britisches Pfund
893
26	BND	Brunei-Dollar
894
27	BGN	Bulgarischer Lew
895
28	BIF	Burundi-Franc
896
29	XOF	CFA-Franc BCEAO
897
30	XAF	CFA-Franc BEAC
898
31	CLP	Chilenischer Peso
899
32	CNY	Chinesischer Renminbi Yuan
900
33	CRC	Costa-Rica-Colon
38 andreas 901
34	DKK	Dänische Krone
4 andreas 902
35	DEM	Deutsche Mark
903
36	DOP	Dominikanischer Peso
904
37	DJF	Dschibuti-Franc
905
38	XEU	ECU
906
39	ECS	Ecuadorianischer Sucre
907
40	SVC	El-Salvador-Colon
908
41	EEK	Estnische Krone
909
42	EUR	Euro
910
43	FKP	Falkland-Pfund
911
44	FJD	Fidschi-Dollar
912
45	FIM	Finnische Mark
38 andreas 913
46	FRF	Französischer Franc
4 andreas 914
47	GMD	Gambischer Dalasi
915
48	GHC	Ghanaischer Cedi
916
49	GIP	Gibraltar-Pfund
917
50	XAU	Gold (Unze)
918
51	GRD	Griechische Drachme
919
52	GTQ	Guatemaltekischer Quetzal
920
53	GNF	Guinea-Franc
921
54	GYD	Guyana-Dollar
922
55	HTG	Haitianische Gourde
38 andreas 923
56	NLG	Niederländischer Gulden
4 andreas 924
57	HNL	Honduranische Lempira
925
58	HKD	Hongkong-Dollar
926
59	INR	Indische Rupie
927
60	IDR	Indonesische Rupiah
928
61	IQD	Irakischer Dinar
929
62	IRR	Iranischer Rial
930
63	IEP	Irisches Pfund
38 andreas 931
64	ISK	Isländische Krone
4 andreas 932
65	ILS	Israelischer Neuer Schekel
933
66	ITL	Italienische Lire
934
67	JMD	Jamaikanischer Dollar
935
68	JPY	Japanischer Yen
936
69	JOD	Jordanischer Dinar
937
70	YUN	Jugoslawischer Dinar
938
71	KYD	Kaiman-Dollar
939
72	KHR	Kambodschanischer Riel
940
73	CAD	Kanadischer Dollar
941
74	CVE	Kap-Verde-Escudo
942
75	KZT	Kasachstan-Tenge
943
76	QAR	Katar-Rial
944
77	KES	Kenianischer Schilling
945
78	COP	Kolumbianischer Peso
946
79	KMF	Komoren-Franc
947
80	HRK	Kroatische Kuna
948
81	CUP	Kubanischer Peso
949
82	KWD	Kuwaitischer Dinar
950
83	LAK	Laotischer Kip
951
84	LSL	Lesothischer Loti
952
85	LVL	Lettische Lats
953
86	LBP	Libanesisches Pfund
954
87	LRD	Liberianischer Dollar
955
88	LYD	Lybischer Dinar
956
89	LTL	Litauische Litas
957
90	LUF	Luxemburgischer Franc
958
91	MOP	Macauische Pataca
959
92	MGF	Madagaskar-Franc
960
93	MWK	Malawi-Kwacha
961
94	MYR	Malaysischer Ringgit
962
95	MVR	Maledivische Rufiyaa
963
96	MTL	Maltesische Lire
964
97	MAD	Marokkanischer Dirham
965
98	MRO	Mauretanische Ouguiya
966
99	MUR	Mauritius-Rupie
967
100	MXP	Mexikanischer Peso
968
101	MNT	Mongolischer Tugrik
969
102	MZM	Mosambikanischer Metical
970
103	MMK	Myanmarischer Kyat
971
104	ANG	NL-Antillen-Gulden
972
105	NAD	Namibischer Dollar
973
106	NPR	Nepalesische Rupie
38 andreas 974
107	NZD	Neuseeländischer Dollar
4 andreas 975
108	NIO	Nicaraguanischer Cordoba Oro
976
109	NGN	Nigerianische Naira
977
110	KPW	Nordkoreanischer Won
978
111	NOK	Norwegische Krone
979
112	OMR	Omani-Rial
980
113	PKR	Pakistanische Rupie
981
114	XPD	Palladium (Unze)
982
115	PAB	Panamaischer Balboa
983
116	PGK	Papua-Neuguinea-Kina
984
117	PYG	Paraguayischer Guarani
985
118	PEN	Peruanischer Sol
986
119	PHP	Philippinischer Peso
987
120	XPT	Platin (Unze)
988
121	PLZ	Polnischer Zloty
989
122	PTE	Portugiesischer Escudo
38 andreas 990
123	ROL	Rumänischer Leu
4 andreas 991
124	RUB	Russischer Rubel
992
125	STD	Sao-Tome/Principe-Dobra
38 andreas 993
126	ZAR	Südafrikanischer Rand
994
127	KRW	Südkoreanischer Won
4 andreas 995
128	SBD	Salomonen-Dollar
996
129	ZMK	Sambischer Kwacha
997
130	WST	Samoanischer Tala
998
131	SAR	Saudi-Riyal
999
132	SEK	Schwedische Krone
1000
133	CHF	Schweizer Franken
1001
134	SCR	Seychellen-Rupie
1002
135	SLL	Sierraleonische Leone
1003
136	XAG	Silber (Unze)
1004
137	ZWD	Simbabwe-Dollar
1005
138	SGD	Singapur-Dollar
1006
139	SKK	Slovakische Krone
1007
140	SIT	Slowenischer Tolar
1008
141	SOS	Somalischer Schilling
1009
142	ESP	Spanische Pesete
1010
143	LKR	Sri-Lanka-Rupie
1011
144	SHP	St. Helena-Pfund
1012
145	SDD	Sudanesischer Dinar
1013
146	SDP	Sudanesisches Pfund
1014
147	SRG	Suriname-Gulden
38 andreas 1015
148	SZL	Swasiländischer Lilangeni
4 andreas 1016
149	SYP	Syrisches Pfund
38 andreas 1017
150	TRL	Türkische Lira
4 andreas 1018
151	TWD	Taiwanesischer Dollar
1019
152	TZS	Tansania-Schilling
38 andreas 1020
153	THB	Thailändischer Baht
4 andreas 1021
154	TOP	Tongaische Pa anga
1022
155	TTD	Trinidad/Tobago-Dollar
1023
156	CSK	Tschechische Krone
1024
157	TND	Tunesischer Dinar
1025
158	UGS	Uganda-Schilling
1026
159	UAH	Ukrainische Griwna
1027
160	HUF	Ungarischer Forint
1028
161	UYP	Uruguayischer Peso
1029
162	VUV	Vanuatu-Vatu
1030
163	VEB	Venezuelanischer Bolivar
1031
164	AED	Vereinigte Arabische Emirate-Dirham
1032
165	VND	Vietnamesischer Dong
1033
166	CYP	Zypern-Pfund
1034
\.
1035