193 |
ALTER TABLE dossier ADD COLUMN avis_decision integer; |
ALTER TABLE dossier ADD COLUMN avis_decision integer; |
194 |
|
|
195 |
|
|
196 |
|
|
197 |
|
|
198 |
|
|
199 |
UPDATE consultation SET avis_consultation=(select avis_consultation.avis_consultation from avis_consultation where avis=avis_consultation.avis_old); |
UPDATE consultation SET avis_consultation=(select avis_consultation.avis_consultation from avis_consultation where avis=avis_consultation.avis_old); |
200 |
|
|
201 |
-- |
-- |
256 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_service_service_categorie', '4'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_service_service_categorie', '4'); |
257 |
|
|
258 |
ALTER TABLE consultation ALTER service SET NOT NULL; |
ALTER TABLE consultation ALTER service SET NOT NULL; |
259 |
ALTER TABLE dossier ADD COLUMN enjeu boolean; |
ALTER TABLE dossier ADD COLUMN enjeu_erp boolean; |
260 |
|
ALTER TABLE dossier ADD COLUMN enjeu_urba boolean; |
261 |
|
|
262 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_mes_retours', 4); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_mes_retours', 4); |
263 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_tous_retours', 4); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_tous_retours', 4); |
264 |
|
|
365 |
ALTER TABLE ONLY arrondissement |
ALTER TABLE ONLY arrondissement |
366 |
ADD CONSTRAINT arrondissement_pkey PRIMARY KEY (arrondissement); |
ADD CONSTRAINT arrondissement_pkey PRIMARY KEY (arrondissement); |
367 |
|
|
368 |
|
CREATE SEQUENCE arrondissement_seq |
369 |
|
INCREMENT 1 |
370 |
|
MINVALUE 1 |
371 |
|
MAXVALUE 9223372036854775807 |
372 |
|
START 1 |
373 |
|
CACHE 1; |
374 |
|
|
375 |
CREATE TABLE quartier ( |
CREATE TABLE quartier ( |
376 |
quartier integer NOT NULL, |
quartier integer NOT NULL, |
377 |
arrondissement integer NOT NULL, |
arrondissement integer NOT NULL, |
384 |
ALTER TABLE ONLY quartier |
ALTER TABLE ONLY quartier |
385 |
ADD CONSTRAINT quartier_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement); |
ADD CONSTRAINT quartier_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement); |
386 |
|
|
387 |
|
CREATE SEQUENCE quartier_seq |
388 |
|
INCREMENT 1 |
389 |
|
MINVALUE 1 |
390 |
|
MAXVALUE 9223372036854775807 |
391 |
|
START 1 |
392 |
|
CACHE 1; |
393 |
|
|
394 |
CREATE TABLE lien_localisation_nature ( |
CREATE TABLE lien_localisation_nature ( |
395 |
lien_localisation_nature integer NOT NULL, |
lien_localisation_nature integer NOT NULL, |
396 |
nature character varying(2), |
nature character varying(2), |
411 |
ALTER TABLE ONLY lien_localisation_nature |
ALTER TABLE ONLY lien_localisation_nature |
412 |
ADD CONSTRAINT lien_localisation_nature_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur); |
ADD CONSTRAINT lien_localisation_nature_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur); |
413 |
|
|
414 |
|
CREATE SEQUENCE lien_localisation_nature_seq |
415 |
|
INCREMENT 1 |
416 |
|
MINVALUE 1 |
417 |
|
MAXVALUE 9223372036854775807 |
418 |
|
START 1 |
419 |
|
CACHE 1; |
420 |
|
|
421 |
-- Ajout des droits pour le retour des services |
-- Ajout des droits pour le retour des services |
422 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_encours', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_encours', '2'); |
423 |
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'); |
462 |
type character varying(60), |
type character varying(60), |
463 |
emetteur character varying(40), |
emetteur character varying(40), |
464 |
date_emission DATE NOT NULL, |
date_emission DATE NOT NULL, |
|
enjeux_erp boolean default FALSE, |
|
|
enjeux_urba boolean default FALSE, |
|
465 |
lu boolean default FALSE, |
lu boolean default FALSE, |
466 |
FOREIGN KEY ( dossier ) REFERENCES dossier ( dossier ) -- add this |
FOREIGN KEY ( dossier ) REFERENCES dossier ( dossier ) -- add this |
467 |
); |
); |
470 |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'menu_suivi', '2'); |
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'menu_suivi', '2'); |
471 |
|
|
472 |
-- Droit de l'ajout forcé d'un instructeur |
-- Droit de l'ajout forcé d'un instructeur |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'dossier_modifier_instructeur', '2'); |
|
473 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'dossier_modifier_instructeur', '2'); |
474 |
|
|
475 |
|
-- Module 1 |
476 |
|
CREATE TABLE dossier_autorisation_type ( |
477 |
|
dossier_autorisation_type integer, |
478 |
|
code character varying(20), |
479 |
|
libelle character varying(100), |
480 |
|
description text, |
481 |
|
confidentiel boolean default FALSE |
482 |
|
); |
483 |
|
|
484 |
|
ALTER TABLE ONLY dossier_autorisation_type |
485 |
|
ADD CONSTRAINT dossier_autorisation_type_pkey PRIMARY KEY (dossier_autorisation_type); |
486 |
|
|
487 |
|
CREATE SEQUENCE dossier_autorisation_type_seq |
488 |
|
INCREMENT 1 |
489 |
|
MINVALUE 1 |
490 |
|
MAXVALUE 9223372036854775807 |
491 |
|
START 1 |
492 |
|
CACHE 1; |
493 |
|
|
494 |
|
-- |
495 |
|
|
496 |
|
CREATE TABLE dossier_autorisation_type_detaille ( |
497 |
|
dossier_autorisation_type_detaille integer, |
498 |
|
code character varying(20), |
499 |
|
libelle character varying(100), |
500 |
|
description text, |
501 |
|
dossier_autorisation_type integer |
502 |
|
); |
503 |
|
|
504 |
|
ALTER TABLE ONLY dossier_autorisation_type_detaille |
505 |
|
ADD CONSTRAINT dossier_autorisation_type_detaille_pkey PRIMARY KEY (dossier_autorisation_type_detaille); |
506 |
|
ALTER TABLE ONLY dossier_autorisation_type_detaille |
507 |
|
ADD CONSTRAINT dossier_autorisation_type_detaille_dossier_autorisation_type_fkey FOREIGN KEY (dossier_autorisation_type) REFERENCES dossier_autorisation_type(dossier_autorisation_type); |
508 |
|
|
509 |
|
CREATE SEQUENCE dossier_autorisation_type_detaille_seq |
510 |
|
INCREMENT 1 |
511 |
|
MINVALUE 1 |
512 |
|
MAXVALUE 9223372036854775807 |
513 |
|
START 1 |
514 |
|
CACHE 1; |
515 |
|
|
516 |
|
-- |
517 |
|
|
518 |
|
CREATE TABLE dossier_instruction_type ( |
519 |
|
dossier_instruction_type integer, |
520 |
|
code character varying(20), |
521 |
|
libelle character varying(100), |
522 |
|
description text, |
523 |
|
dossier_autorisation_type_detaille integer, |
524 |
|
suffixe boolean default FALSE |
525 |
|
); |
526 |
|
|
527 |
|
ALTER TABLE ONLY dossier_instruction_type |
528 |
|
ADD CONSTRAINT dossier_instruction_type_pkey PRIMARY KEY (dossier_instruction_type); |
529 |
|
ALTER TABLE ONLY dossier_instruction_type |
530 |
|
ADD CONSTRAINT dossier_instruction_type_dossier_autorisation_type_detaille_fkey FOREIGN KEY (dossier_autorisation_type_detaille) REFERENCES dossier_autorisation_type_detaille(dossier_autorisation_type_detaille); |
531 |
|
|
532 |
|
CREATE SEQUENCE dossier_instruction_type_seq |
533 |
|
INCREMENT 1 |
534 |
|
MINVALUE 1 |
535 |
|
MAXVALUE 9223372036854775807 |
536 |
|
START 1 |
537 |
|
CACHE 1; |
538 |
|
|
539 |
|
-- |
540 |
|
|
541 |
|
CREATE TABLE demande_genre ( |
542 |
|
demande_genre integer, |
543 |
|
code character varying(20), |
544 |
|
libelle character varying(100), |
545 |
|
description text |
546 |
|
); |
547 |
|
|
548 |
|
ALTER TABLE ONLY demande_genre |
549 |
|
ADD CONSTRAINT demande_genre_pkey PRIMARY KEY (demande_genre); |
550 |
|
|
551 |
|
CREATE SEQUENCE demande_genre_seq |
552 |
|
INCREMENT 1 |
553 |
|
MINVALUE 1 |
554 |
|
MAXVALUE 9223372036854775807 |
555 |
|
START 1 |
556 |
|
CACHE 1; |
557 |
|
|
558 |
|
-- |
559 |
|
|
560 |
|
CREATE TABLE groupe ( |
561 |
|
groupe integer, |
562 |
|
code character varying(20), |
563 |
|
libelle character varying(100), |
564 |
|
description text, |
565 |
|
demande_genre integer |
566 |
|
); |
567 |
|
|
568 |
|
ALTER TABLE ONLY groupe |
569 |
|
ADD CONSTRAINT groupe_pkey PRIMARY KEY (groupe); |
570 |
|
ALTER TABLE ONLY groupe |
571 |
|
ADD CONSTRAINT groupe_demande_genre_fkey FOREIGN KEY (demande_genre) REFERENCES demande_genre(demande_genre); |
572 |
|
|
573 |
|
CREATE SEQUENCE groupe_seq |
574 |
|
INCREMENT 1 |
575 |
|
MINVALUE 1 |
576 |
|
MAXVALUE 9223372036854775807 |
577 |
|
START 1 |
578 |
|
CACHE 1; |
579 |
|
|
580 |
|
-- Ajout de clé étrangère à la table dossier_autorisation_type |
581 |
|
ALTER TABLE dossier_autorisation_type ADD COLUMN groupe integer; |
582 |
|
ALTER TABLE ONLY dossier_autorisation_type |
583 |
|
ADD CONSTRAINT dossier_autorisation_type_groupe_fkey FOREIGN KEY (groupe) REFERENCES groupe(groupe); |
584 |
|
|
585 |
|
--Demande nature |
586 |
|
|
587 |
|
CREATE TABLE demande_nature ( |
588 |
|
demande_nature integer, |
589 |
|
code character varying(20), |
590 |
|
libelle character varying(100), |
591 |
|
description text |
592 |
|
); |
593 |
|
|
594 |
|
ALTER TABLE ONLY demande_nature |
595 |
|
ADD CONSTRAINT demande_nature_pkey PRIMARY KEY (demande_nature); |
596 |
|
|
597 |
|
CREATE SEQUENCE demande_nature_seq |
598 |
|
INCREMENT 1 |
599 |
|
MINVALUE 1 |
600 |
|
MAXVALUE 9223372036854775807 |
601 |
|
START 1 |
602 |
|
CACHE 1; |
603 |
|
|
604 |
|
--Demande type |
605 |
|
|
606 |
|
CREATE TABLE demande_type ( |
607 |
|
demande_type integer, |
608 |
|
code character varying(20), |
609 |
|
libelle character varying(100), |
610 |
|
description text, |
611 |
|
demande_nature integer, |
612 |
|
groupe integer, |
613 |
|
dossier_instruction_type integer, |
614 |
|
dossier_autorisation_type_detaille integer, |
615 |
|
contraintes character varying(20), |
616 |
|
etats_dossier_autorisation_autorises character varying(100), |
617 |
|
qualification boolean, |
618 |
|
evenement integer |
619 |
|
); |
620 |
|
|
621 |
|
ALTER TABLE ONLY demande_type |
622 |
|
ADD CONSTRAINT demande_type_pkey PRIMARY KEY (demande_type); |
623 |
|
ALTER TABLE ONLY demande_type |
624 |
|
ADD CONSTRAINT demande_type_demande_nature_fkey FOREIGN KEY (demande_nature) REFERENCES demande_nature(demande_nature); |
625 |
|
ALTER TABLE ONLY demande_type |
626 |
|
ADD CONSTRAINT demande_type_groupe_fkey FOREIGN KEY (groupe) REFERENCES groupe(groupe); |
627 |
|
ALTER TABLE ONLY demande_type |
628 |
|
ADD CONSTRAINT demande_type_dossier_instruction_type_fkey FOREIGN KEY (dossier_instruction_type) REFERENCES dossier_instruction_type(dossier_instruction_type); |
629 |
|
ALTER TABLE ONLY demande_type |
630 |
|
ADD CONSTRAINT demande_type_dossier_autorisation_type_detaille_fkey FOREIGN KEY (dossier_autorisation_type_detaille) REFERENCES dossier_autorisation_type_detaille(dossier_autorisation_type_detaille); |
631 |
|
ALTER TABLE ONLY demande_type |
632 |
|
ADD CONSTRAINT demande_type_evenement_fkey FOREIGN KEY (evenement) REFERENCES evenement(evenement); |
633 |
|
|
634 |
|
CREATE SEQUENCE demande_type_seq |
635 |
|
INCREMENT 1 |
636 |
|
MINVALUE 1 |
637 |
|
MAXVALUE 9223372036854775807 |
638 |
|
START 1 |
639 |
|
CACHE 1; |
640 |
|
|
641 |
|
-- |
642 |
|
|
643 |
|
CREATE TABLE lien_evenement_dossier_autorisation_type ( |
644 |
|
lien_evenement_dossier_autorisation_type integer, |
645 |
|
evenement integer, |
646 |
|
dossier_autorisation_type integer |
647 |
|
); |
648 |
|
|
649 |
|
ALTER TABLE ONLY lien_evenement_dossier_autorisation_type |
650 |
|
ADD CONSTRAINT lien_evenement_dossier_autorisation_type_pkey PRIMARY KEY (lien_evenement_dossier_autorisation_type); |
651 |
|
ALTER TABLE ONLY lien_evenement_dossier_autorisation_type |
652 |
|
ADD CONSTRAINT lien_evenement_dossier_autorisation_type_evenement_fkey FOREIGN KEY (evenement) REFERENCES evenement(evenement); |
653 |
|
ALTER TABLE ONLY lien_evenement_dossier_autorisation_type |
654 |
|
ADD CONSTRAINT lien_evenement_dossier_autorisation_type_dossier_autorisation_type_fkey FOREIGN KEY (dossier_autorisation_type) REFERENCES dossier_autorisation_type(dossier_autorisation_type); |
655 |
|
|
656 |
|
CREATE SEQUENCE lien_evenement_dossier_autorisation_type_seq |
657 |
|
INCREMENT 1 |
658 |
|
MINVALUE 1 |
659 |
|
MAXVALUE 9223372036854775807 |
660 |
|
START 1 |
661 |
|
CACHE 1; |
662 |
|
|
663 |
|
-- |
664 |
|
|
665 |
|
CREATE TABLE autorite_competente ( |
666 |
|
autorite_competente integer, |
667 |
|
code character varying(20), |
668 |
|
libelle character varying(100), |
669 |
|
description text |
670 |
|
); |
671 |
|
|
672 |
|
ALTER TABLE ONLY autorite_competente |
673 |
|
ADD CONSTRAINT autorite_competente_pkey PRIMARY KEY (autorite_competente); |
674 |
|
|
675 |
|
CREATE SEQUENCE autorite_competente_seq |
676 |
|
INCREMENT 1 |
677 |
|
MINVALUE 1 |
678 |
|
MAXVALUE 9223372036854775807 |
679 |
|
START 1 |
680 |
|
CACHE 1; |
681 |
|
|
682 |
|
-- Ajout de clé étrangère à la table dossier_autorisation_type |
683 |
|
ALTER TABLE dossier ADD COLUMN autorite_competente integer; |
684 |
|
ALTER TABLE ONLY dossier |
685 |
|
ADD CONSTRAINT dossier_autorite_competente_fkey FOREIGN KEY (autorite_competente) REFERENCES autorite_competente(autorite_competente); |
686 |
|
|
687 |
|
-- Donnees des tables |
688 |
|
INSERT INTO dossier_autorisation_type(dossier_autorisation_type, code, libelle) SELECT nextval('dossier_autorisation_type_seq'), nature, libelle FROM nature; |
689 |
|
INSERT INTO dossier_autorisation_type_detaille(dossier_autorisation_type_detaille, code, libelle) SELECT nextval('dossier_autorisation_type_seq'), nature, libelle FROM nature; |
690 |
|
|
691 |
|
INSERT INTO demande_genre VALUES (nextval('demande_genre_seq'), 'URBA', 'Pôle Urbanisme', 'Responsabilité de la DDU'); |
692 |
|
INSERT INTO demande_genre VALUES (nextval('demande_genre_seq'), 'ERP', 'Pôle ERP', 'Responsabilité de la DGUP'); |
693 |
|
|
694 |
|
INSERT INTO groupe VALUES (nextval('groupe_seq'), 'ADS', 'Autorisation ADS', '',1); |
695 |
|
INSERT INTO groupe VALUES (nextval('groupe_seq'), 'CTX', 'Contentieux dans le domaine urbanisme', '',1); |
696 |
|
INSERT INTO groupe VALUES (nextval('groupe_seq'), 'CU', 'Changement d''usage', '',1); |
697 |
|
INSERT INTO groupe VALUES (nextval('groupe_seq'), 'RU', 'Renseignement d''urbanisme', '',1); |
698 |
|
INSERT INTO groupe VALUES (nextval('groupe_seq'), 'ERP', 'ERP', '',2); |