1 |
-- |
-- |
2 |
|
-- Ajout de table: avis_consultation_tmp; |
3 |
|
-- |
4 |
|
|
5 |
|
|
6 |
|
CREATE TABLE avis_consultation_tmp ( |
7 |
|
avis character varying(2) NOT NULL, |
8 |
|
libelle character varying(30) NOT NULL, |
9 |
|
typeavis character(1) DEFAULT ''::bpchar NOT NULL, |
10 |
|
sitadel character(1) DEFAULT ''::bpchar NOT NULL, |
11 |
|
sitadel_motif character(1) DEFAULT ''::bpchar NOT NULL |
12 |
|
); |
13 |
|
|
14 |
|
|
15 |
|
-- |
16 |
|
-- Data for Name: avis_consultation_tmp; |
17 |
|
-- |
18 |
|
|
19 |
|
INSERT INTO avis_consultation_tmp VALUES ('D', 'Defavorable', 'D', '6', ' '); |
20 |
|
INSERT INTO avis_consultation_tmp VALUES ('F', 'Favorable', 'F', '4', ' '); |
21 |
|
INSERT INTO avis_consultation_tmp VALUES ('F1', 'Favorable avec Reserve', 'F', '4', ' '); |
22 |
|
INSERT INTO avis_consultation_tmp VALUES ('T', 'Tacite', 'F', '2', ' '); |
23 |
|
INSERT INTO avis_consultation_tmp VALUES ('A', 'Autre', ' ', '7', ' '); |
24 |
|
|
25 |
|
|
26 |
|
-- |
27 |
-- Ajout de la table 'service_categorie' |
-- Ajout de la table 'service_categorie' |
28 |
-- |
-- |
29 |
CREATE TABLE service_categorie ( |
CREATE TABLE service_categorie ( |
169 |
|
|
170 |
ALTER TABLE avis_consultation ADD COLUMN avis_consultation integer NOT NULL DEFAULT nextval('avis_consultation_seq'::regclass); |
ALTER TABLE avis_consultation ADD COLUMN avis_consultation integer NOT NULL DEFAULT nextval('avis_consultation_seq'::regclass); |
171 |
INSERT INTO avis_consultation(avis_old, libelle) SELECT avis, libelle |
INSERT INTO avis_consultation(avis_old, libelle) SELECT avis, libelle |
172 |
FROM avis; |
FROM avis_consultation_tmp; |
173 |
|
|
174 |
|
|
175 |
ALTER TABLE ONLY avis_decision |
ALTER TABLE ONLY avis_decision |
225 |
ALTER TABLE avis_decision DROP COLUMN avis_old; |
ALTER TABLE avis_decision DROP COLUMN avis_old; |
226 |
ALTER TABLE avis_consultation DROP COLUMN avis_old; |
ALTER TABLE avis_consultation DROP COLUMN avis_old; |
227 |
DROP TABLE avis; |
DROP TABLE avis; |
228 |
|
DROP TABLE avis_consultation_tmp; |
229 |
|
|
230 |
-- |
-- |
231 |
-- Ajout des droits sur l'objet consultation_encours |
-- Ajout des droits sur l'objet consultation_encours |
348 |
-- |
-- |
349 |
CREATE TABLE arrondissement ( |
CREATE TABLE arrondissement ( |
350 |
arrondissement integer NOT NULL, |
arrondissement integer NOT NULL, |
351 |
numero character varying(3) NOT NULL |
libelle character varying(3) NOT NULL |
352 |
); |
); |
353 |
|
|
354 |
ALTER TABLE ONLY arrondissement |
ALTER TABLE ONLY arrondissement |
356 |
|
|
357 |
CREATE TABLE quartier ( |
CREATE TABLE quartier ( |
358 |
quartier integer NOT NULL, |
quartier integer NOT NULL, |
359 |
|
arrondissement integer NOT NULL, |
360 |
code_impots character varying(3) NOT NULL, |
code_impots character varying(3) NOT NULL, |
361 |
libelle character varying(40) NOT NULL |
libelle character varying(40) NOT NULL |
362 |
); |
); |
363 |
|
|
364 |
ALTER TABLE ONLY quartier |
ALTER TABLE ONLY quartier |
365 |
ADD CONSTRAINT quartier_pkey PRIMARY KEY (quartier); |
ADD CONSTRAINT quartier_pkey PRIMARY KEY (quartier); |
366 |
|
ALTER TABLE ONLY quartier |
367 |
|
ADD CONSTRAINT quartier_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement); |
368 |
|
|
369 |
CREATE TABLE lien_localisation_nature ( |
CREATE TABLE lien_localisation_nature ( |
370 |
lien_localisation_nature integer NOT NULL, |
lien_localisation_nature integer NOT NULL, |
371 |
nature character varying(2) NOT NULL, |
nature character varying(2), |
372 |
arrondissement integer NOT NULL, |
arrondissement integer, |
373 |
quartier integer NOT NULL, |
quartier integer , |
374 |
section varchar(10) NOT NULL default '*' |
section varchar(2), |
375 |
|
instructeur integer NOT NULL |
376 |
); |
); |
377 |
|
|
378 |
ALTER TABLE ONLY lien_localisation_nature |
ALTER TABLE ONLY lien_localisation_nature |
383 |
ADD CONSTRAINT lien_localisation_nature_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement); |
ADD CONSTRAINT lien_localisation_nature_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement); |
384 |
ALTER TABLE ONLY lien_localisation_nature |
ALTER TABLE ONLY lien_localisation_nature |
385 |
ADD CONSTRAINT lien_localisation_nature_quartier_fkey FOREIGN KEY (quartier) REFERENCES quartier(quartier); |
ADD CONSTRAINT lien_localisation_nature_quartier_fkey FOREIGN KEY (quartier) REFERENCES quartier(quartier); |
386 |
|
ALTER TABLE ONLY lien_localisation_nature |
387 |
|
ADD CONSTRAINT lien_localisation_nature_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur); |
388 |
|
|
389 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'avis_code_barre', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'avis_code_barre', '2'); |
390 |
|
|
391 |
-- Ajout des droits pour le retour des services |
-- Ajout des droits pour le retour des services |
392 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_encours', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_encours', '2'); |
393 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_retour_service', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_retour_service', '2'); |
394 |
|
|
395 |
-- Suppression des colonnes inutiles dans la table om_utilisateur |
-- Suppression des colonnes inutiles dans la table om_utilisateur |
400 |
-- Ajout des droits sur lien_service_om_utilisateur |
-- Ajout des droits sur lien_service_om_utilisateur |
401 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_service_om_utilisateur', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_service_om_utilisateur', '2'); |
402 |
-- Ajout des droits pour le retour des services |
-- Ajout des droits pour le retour des services |
403 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_passee', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_passee', '2'); |
404 |
|
|
405 |
|
-- Ajout des droits sur lien_localisation_nature |
406 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_localisation_nature', '2'); |
407 |
|
|
408 |
|
-- Ajout du droit pour changer l'état (lu/non lu) d'une consultation |
409 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_modifier_lu', '2'); |
410 |
|
|
411 |
|
-- Changement de taille du champs parcelle de la table parcelle et terrain |
412 |
|
ALTER TABLE parcelle ALTER COLUMN parcelle TYPE character varying(20); |
413 |
|
ALTER TABLE terrain ALTER COLUMN parcelle TYPE character varying(20); |
414 |
|
|