FSN#1128/FSN#1251
svn path=/Database/trunk/; revision=9027
This commit is contained in:
133
CAD/CAD_TAB.SRC
133
CAD/CAD_TAB.SRC
@@ -1,23 +1,7 @@
|
||||
#ifdef CAD // 22-05-1998 KTH
|
||||
|
||||
/* REVISIONS:
|
||||
*
|
||||
* 19-03-2003 RL cad_c_cad_tekening_type2 united with "not null" constraint
|
||||
*
|
||||
* 27-04-1999 EGR CAD-tabellen worden op de module FAC afgebeeld met bijbehorende privileges.
|
||||
* --- 01.43 ---
|
||||
* 09-03-1999 BIV LOG #2278 - MB: cad_symbool.cad_symbool_kleur moet NUMBER(3) worden.
|
||||
* 26-02-1999 BIV LOG #2278 - Tabel cad_symbool toegevoegd t.b.v. Facilitor 3.
|
||||
* 11-02-1999 BIV LOG#2252 Velden ..._aanmaak en ..._verwijder toegevoegd aan cad_tekening.
|
||||
* 02-12-1998 PF CONSTRAINT cad_u_cad_tekening verbeterd (onderscheid BIS weg)
|
||||
* --- 01.42 ---
|
||||
* --- 01.41 ---
|
||||
* --- 01.40 ---
|
||||
* --- 01.39 ---
|
||||
* --- 01.38 ---
|
||||
* 30-06-1998 BIV LOG#1902: NOT NULL van CAD_TEKENING.INS_DISCIPLINE_KEY eraf
|
||||
* --- 01.37 ---
|
||||
* 22-05-1998 KTH LOG#1821: Wijzigingen tbv tabel CAD_TEKENING geintroduceerd
|
||||
/* $Revision: 14 $
|
||||
* $Modtime: 21-09-05 13:44 $
|
||||
*/
|
||||
|
||||
#include "comsql.h"
|
||||
@@ -27,41 +11,37 @@ CREATE_TABLE(cad_tekening, FAC_NORMAAL_PRIVILEGE)
|
||||
cad_tekening_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_k_cad_tekening_key PRIMARY KEY,
|
||||
ins_discipline_key /* als deze leeg is geeft betreft het de Contour-tekening */
|
||||
ins_discipline_key /* reserved for future use */
|
||||
NUMBER(10)
|
||||
--#1902 NOT_NULL(ins_discipline_key, cad_c_ins_discipline_key)
|
||||
CONSTRAINT cad_r_ins_discipline_key REFERENCES ins_tab_discipline(ins_discipline_key),
|
||||
alg_locatie_key
|
||||
NUMBER(10)
|
||||
FOREIGN KEY (alg_locatie_key)
|
||||
NOT_NULL(alg_locatie_key, cad_c_alg_locatie_key)
|
||||
CONSTRAINT cad_r_alg_locatie_key REFERENCES alg_locatie(alg_locatie_key),
|
||||
alg_verdieping_key /* is optioneel NULL */
|
||||
CONSTRAINT cad_r_alg_locatie_key REFERENCES alg_locatie(alg_locatie_key) ON DELETE CASCADE,
|
||||
alg_verdieping_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_r_alg_verdieping_key REFERENCES alg_verdieping(alg_verdieping_key),
|
||||
cad_tekening_filenaam /* excl. leading PATH (komt uit INI-file), incl. extension */
|
||||
FOREIGN KEY (alg_verdieping_key)
|
||||
CONSTRAINT cad_r_alg_verdieping_key REFERENCES alg_verdieping(alg_verdieping_key) ON DELETE CASCADE,
|
||||
cad_tekening_filenaam
|
||||
VARCHAR2(256)
|
||||
NOT_NULL(cad_tekening_filenaam, cad_c_cad_tekening_filenaam),
|
||||
cad_tekening_type
|
||||
VARCHAR2(3)
|
||||
/* NOT_NULL (cad_tekening_type, cad_c_cad_tekening_type) */
|
||||
CONSTRAINT cad_c_cad_tekening_type2 CHECK
|
||||
(cad_tekening_type is not null and
|
||||
(cad_tekening_type = 'P' OR cad_tekening_type = 'C'
|
||||
OR cad_tekening_type = 'D')),
|
||||
cad_tekening_geimporteerd /* geeft aan of de tekening al is geimporteerd: */
|
||||
DATE /* NULL indien niet, anders datum van importeren */
|
||||
DEFAULT NULLDATUM,
|
||||
NOT_NULL (cad_tekening_type, cad_c_cad_tekening_type)
|
||||
CONSTRAINT cad_c_cad_tekening_type2 CHECK (cad_tekening_type = 'P' OR cad_tekening_type = 'C'),
|
||||
cad_tekening_geimporteerd
|
||||
DATE,
|
||||
cad_tekening_aanmaak
|
||||
DATE
|
||||
DEFAULT SYSDATE
|
||||
CONSTRAINT cad_c_cad_tekening_aanmaak NOT NULL,
|
||||
cad_tekening_verwijder
|
||||
DATE
|
||||
DEFAULT NULLDATUM,
|
||||
DATE,
|
||||
CONSTRAINT cad_u_cad_tekening UNIQUE(alg_locatie_key,alg_verdieping_key,cad_tekening_type,ins_discipline_key, cad_tekening_verwijder)
|
||||
);
|
||||
|
||||
|
||||
/*
|
||||
CREATE_TABLE(cad_slnkstruct, FAC_NORMAAL_PRIVILEGE)
|
||||
(
|
||||
cad_slnkstruct_sessionid
|
||||
@@ -99,5 +79,88 @@ CREATE_TABLE(cad_symbool, FAC_BIBLIOTHEEK_PRIVILEGE)
|
||||
NUMBER(3)
|
||||
CONSTRAINT cad_c_cad_symbool_kleur CHECK(cad_symbool_kleur BETWEEN 1 AND 255)
|
||||
);
|
||||
*/
|
||||
|
||||
/* Algemeen bruikbare legenda's en bijbehorende waarde/kleur */
|
||||
CREATE_TABLE(cad_legenda,0)
|
||||
(
|
||||
cad_legenda_key
|
||||
NUMBER(10) PRIMARY KEY,
|
||||
cad_legenda_omschrijving
|
||||
VARCHAR2(32)
|
||||
);
|
||||
|
||||
CREATE_TABLE(cad_legendawaarde,0)
|
||||
(
|
||||
cad_legendawaarde_key
|
||||
NUMBER(10) PRIMARY KEY,
|
||||
cad_legenda_key
|
||||
NUMBER (10) CONSTRAINT cad_r_cad_legenda REFERENCES cad_legenda(cad_legenda_key) ON DELETE CASCADE,
|
||||
cad_legendawaarde_value
|
||||
VARCHAR2(255),
|
||||
cad_legendawaarde_rgb
|
||||
VARCHAR2(10),
|
||||
cad_legendawaarde_omschrijving
|
||||
VARCHAR2(60)
|
||||
);
|
||||
|
||||
|
||||
/* Welke thema's zijn gedefinieerd?
|
||||
* _type: 1=binnen, 2=buiten, 1+2=3 binnen en buiten
|
||||
*/
|
||||
|
||||
CREATE_TABLE(cad_thema,0)
|
||||
(
|
||||
cad_thema_key
|
||||
NUMBER(10) PRIMARY KEY,
|
||||
cad_thema_omschrijving
|
||||
VARCHAR2(60),
|
||||
cad_legenda_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_r_cad_legenda_key REFERENCES cad_legenda(cad_legenda_key) ON DELETE SET NULL,
|
||||
cad_thema_view
|
||||
VARCHAR2(1000)
|
||||
NOT_NULL(cad_thema_view, cad_c_cad_thema_view),
|
||||
cad_thema_type VARCHAR2(1)
|
||||
CONSTRAINT cad_c_cad_thema_type CHECK (cad_thema_type IN (1,2,3)),
|
||||
fac_functie_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_fac_functie_key1 REFERENCES fac_functie(fac_functie_key)
|
||||
);
|
||||
|
||||
CREATE_TABLE(cad_label,0)
|
||||
(
|
||||
cad_label_key
|
||||
NUMBER(10) PRIMARY KEY,
|
||||
cad_label_omschrijving
|
||||
VARCHAR2(60),
|
||||
cad_label_view
|
||||
VARCHAR2(1000)
|
||||
NOT_NULL(cad_label_view, cad_c_cad_label_view),
|
||||
cad_label_type
|
||||
VARCHAR2(1)
|
||||
CONSTRAINT cad_c_cad_label_type CHECK (cad_label_type IN (1,2,3)),
|
||||
cad_label_size
|
||||
NUMBER,
|
||||
fac_functie_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_fac_functie_key2 REFERENCES fac_functie(fac_functie_key)
|
||||
);
|
||||
|
||||
CREATE_TABLE(cad_imp_contour,0)
|
||||
(
|
||||
cad_imp_contour_key
|
||||
NUMBER(10) PRIMARY KEY,
|
||||
cad_tekening_key
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_r_cad_tekening_key REFERENCES cad_tekening(cad_tekening_key) ON DELETE CASCADE,
|
||||
cad_imp_contour_nr
|
||||
VARCHAR2(30),
|
||||
cad_imp_contour_opp
|
||||
NUMBER(9,2),
|
||||
ins_discipline_key /* reserved for future use: required if we scan object contours */
|
||||
NUMBER(10)
|
||||
CONSTRAINT cad_r_ins_discipline_key2 REFERENCES ins_tab_discipline(ins_discipline_key) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
#endif // CAD
|
||||
|
||||
Reference in New Issue
Block a user