· 5 years ago · Sep 05, 2020, 04:32 PM
1DROP TABLE IF EXISTS t279_tarifgarantie;
2CREATE TABLE t279_tarifgarantie (
3t279_codeinterne_i numeric not null ,
4t279_codeexterne_va character varying(255) ,
5t279_datedebut_d timestamp without time zone ,
6t279_datefin_d timestamp without time zone
7,t209_codeinterne_i numeric
8,t278_codeinterne_i numeric
9);
10ALTER TABLE t279_tarifgarantie ADD CONSTRAINT pk_t279_codeinterne_i PRIMARY KEY(t279_codeinterne_i);
11CREATE INDEX pk_t279_codeinterne_i_idx ON t279_tarifgarantie USING btree (t279_codeinterne_i);
12ALTER TABLE t279_tarifgarantie ADD CONSTRAINT fk_t209_codeinterne_i_cons FOREIGN KEY (t209_codeinterne_i) REFERENCES t209_sousrisque(t209_codeinterne_i) MATCH SIMPLE ON UPDATE RESTRICT ON DELETE RESTRICT;
13ALTER TABLE t279_tarifgarantie ADD CONSTRAINT fk_t278_codeinterne_i_cons FOREIGN KEY (t278_codeinterne_i) REFERENCES t278_tarifs(t278_codeinterne_i) MATCH SIMPLE ON UPDATE RESTRICT ON DELETE RESTRICT;
14CREATE INDEX fk_t209_codeinterne_i_fk_2107 ON t279_tarifgarantie USING btree (t209_codeinterne_i);
15CREATE INDEX fk_t278_codeinterne_i_fk_2109 ON t279_tarifgarantie USING btree (t278_codeinterne_i);
16