/[openfoncier]/trunk/data/pgsql/v3.2.0-dev.sql
ViewVC logotype

Diff of /trunk/data/pgsql/v3.2.0-dev.sql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 915 by mlimic, Thu Nov 29 18:25:39 2012 UTC revision 947 by nhaye, Fri Nov 30 16:11:30 2012 UTC
# Line 362  ALTER TABLE om_parametre ALTER COLUMN va Line 362  ALTER TABLE om_parametre ALTER COLUMN va
362  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');
363    
364  --  --
365  -- Ajout des tables arrondissement, quartier et lien_localisation_nature  -- Ajout des tables arrondissement, quartier et affectation_automatique
366  --  --
367  CREATE TABLE arrondissement (  CREATE TABLE arrondissement (
368          arrondissement integer NOT NULL,          arrondissement integer NOT NULL,
# Line 399  CREATE SEQUENCE quartier_seq Line 399  CREATE SEQUENCE quartier_seq
399    START 1    START 1
400    CACHE 1;    CACHE 1;
401    
402  CREATE TABLE lien_localisation_nature (  CREATE TABLE affectation_automatique (
403          lien_localisation_nature integer NOT NULL,          affectation_automatique integer NOT NULL,
         nature character varying(2),  
404          arrondissement integer,          arrondissement integer,
405          quartier integer ,          quartier integer ,
406          section varchar(2),          section varchar(2),
407          instructeur integer NOT NULL          instructeur integer NOT NULL
408  );  );
409    
410  ALTER TABLE ONLY lien_localisation_nature  ALTER TABLE ONLY affectation_automatique
411      ADD CONSTRAINT lien_localisation_nature_pkey PRIMARY KEY (lien_localisation_nature);      ADD CONSTRAINT affectation_automatique_pkey PRIMARY KEY (affectation_automatique);
412  ALTER TABLE ONLY lien_localisation_nature  ALTER TABLE ONLY affectation_automatique
413      ADD CONSTRAINT lien_localisation_nature_nature_fkey FOREIGN KEY (nature) REFERENCES nature(nature);      ADD CONSTRAINT affectation_automatique_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement);
414  ALTER TABLE ONLY lien_localisation_nature  ALTER TABLE ONLY affectation_automatique
415      ADD CONSTRAINT lien_localisation_nature_arrondissement_fkey FOREIGN KEY (arrondissement) REFERENCES arrondissement(arrondissement);      ADD CONSTRAINT affectation_automatique_quartier_fkey FOREIGN KEY (quartier) REFERENCES quartier(quartier);
416  ALTER TABLE ONLY lien_localisation_nature  ALTER TABLE ONLY affectation_automatique
417      ADD CONSTRAINT lien_localisation_nature_quartier_fkey FOREIGN KEY (quartier) REFERENCES quartier(quartier);      ADD CONSTRAINT affectation_automatique_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur);
 ALTER TABLE ONLY lien_localisation_nature  
     ADD CONSTRAINT lien_localisation_nature_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur);  
418    
419  CREATE SEQUENCE lien_localisation_nature_seq  CREATE SEQUENCE affectation_automatique_seq
420    INCREMENT 1    INCREMENT 1
421    MINVALUE 1    MINVALUE 1
422    MAXVALUE 9223372036854775807    MAXVALUE 9223372036854775807
# Line 439  INSERT INTO om_droit VALUES (nextval('om Line 436  INSERT INTO om_droit VALUES (nextval('om
436  -- Ajout des droits pour le retour des services  -- Ajout des droits pour le retour des services
437  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_passee', '2');  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'demande_avis_passee', '2');
438    
439  -- Ajout des droits sur lien_localisation_nature  -- Ajout des droits sur affectation_automatique
440  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_localisation_nature', '2');  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'affectation_automatique', '2');
441    
442  -- Ajout du droit pour changer l'état (lu/non lu) d'une  consultation  -- Ajout du droit pour changer l'état (lu/non lu) d'une  consultation
443  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_modifier_lu', '2');  INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_modifier_lu', '2');
# Line 465  CREATE SEQUENCE messages_seq Line 462  CREATE SEQUENCE messages_seq
462  -- Create table dossier_message  -- Create table dossier_message
463  CREATE TABLE dossier_message (  CREATE TABLE dossier_message (
464      message integer PRIMARY KEY DEFAULT nextval('messages_seq'),      message integer PRIMARY KEY DEFAULT nextval('messages_seq'),
465      dossier character varying(12),      dossier character varying(20),
466      type character varying(60),      type character varying(60),
467      emetteur character varying(40),      emetteur character varying(40),
468      date_emission TIMESTAMP NOT NULL,      date_emission TIMESTAMP NOT NULL,
# Line 565  CREATE SEQUENCE dossier_autorisation_typ Line 562  CREATE SEQUENCE dossier_autorisation_typ
562    START 1    START 1
563    CACHE 1;    CACHE 1;
564    
565    -- Ajout du champs dossier_autorisation_type_detaille dans la table affectation_automatique et de la contrainte FK
566    
567    ALTER TABLE affectation_automatique ADD COLUMN dossier_autorisation_type_detaille integer;
568    
569    ALTER TABLE ONLY affectation_automatique
570        ADD CONSTRAINT affectation_automatique_dossier_autorisation_type_detaille_fkey FOREIGN KEY (dossier_autorisation_type_detaille) REFERENCES dossier_autorisation_type_detaille(dossier_autorisation_type_detaille);
571    
572  --  --
573    
574  CREATE TABLE dossier_instruction_type (  CREATE TABLE dossier_instruction_type (
# Line 703  INSERT INTO dossier_autorisation_type_de Line 707  INSERT INTO dossier_autorisation_type_de
707  -- Table dossier_autorisation  -- Table dossier_autorisation
708    
709  CREATE TABLE dossier_autorisation (  CREATE TABLE dossier_autorisation (
710      dossier_autorisation character varying(12),      dossier_autorisation character varying(20),
711      nature character varying(2),      nature character varying(2),
712      dossier_autorisation_type_detaille integer,      dossier_autorisation_type_detaille integer,
713      exercice integer,      exercice integer,
# Line 749  CREATE SEQUENCE dossier_autorisation_seq Line 753  CREATE SEQUENCE dossier_autorisation_seq
753    
754  CREATE TABLE demande (  CREATE TABLE demande (
755          demande integer,          demande integer,
756          dossier_autorisation_type_detaille integer,          dossier_autorisation_type_detaille integer NOT NULL,
757          demande_type integer,          demande_type integer NOT NULL,
758          dossier_instruction character varying(12),          dossier_instruction character varying(20),
759          dossier_autorisation character varying(12),          dossier_autorisation character varying(20),
760          date_demande date,          date_demande date NOT NULL,
761          terrain_references_cadastrales character varying(100),          terrain_references_cadastrales character varying(100),
762          terrain_adresse_voie_numero integer,          terrain_adresse_voie_numero integer,
763          complement character varying(30),          complement character varying(30),
# Line 1012  UPDATE civilite SET libelle='Monsieur' W Line 1016  UPDATE civilite SET libelle='Monsieur' W
1016  CREATE TABLE lien_dossier_autorisation_demandeur (  CREATE TABLE lien_dossier_autorisation_demandeur (
1017      lien_dossier_autorisation_demandeur integer,      lien_dossier_autorisation_demandeur integer,
1018      petitionnaire_principal boolean,      petitionnaire_principal boolean,
1019      dossier_autorisation character varying(12),      dossier_autorisation character varying(20),
1020      demandeur integer      demandeur integer
1021  );  );
1022    
# Line 1086  INSERT INTO om_lettretype VALUES (nextva Line 1090  INSERT INTO om_lettretype VALUES (nextva
1090  CREATE TABLE lien_dossier_demandeur (  CREATE TABLE lien_dossier_demandeur (
1091      lien_dossier_demandeur integer,      lien_dossier_demandeur integer,
1092      petitionnaire_principal boolean,      petitionnaire_principal boolean,
1093      dossier character varying(12),      dossier character varying(20),
1094      demandeur integer      demandeur integer
1095  );  );
1096    
# Line 1103  CREATE SEQUENCE lien_dossier_demandeur_s Line 1107  CREATE SEQUENCE lien_dossier_demandeur_s
1107    MAXVALUE 9223372036854775807    MAXVALUE 9223372036854775807
1108    START 1    START 1
1109    CACHE 1;    CACHE 1;
1110    
1111    ALTER TABLE dossier ALTER nature TYPE character varying(3);
1112    ALTER TABLE nature ALTER nature TYPE character varying(3);
1113    ALTER TABLE nature ALTER libelle TYPE character varying(150);
1114    ALTER TABLE dossier ALTER nature DROP NOT NULL;
1115    
1116    INSERT INTO nature VALUES ('PCI', 'Permis de construire pour une maison individuelle et / ou ses annexes');
1117    INSERT INTO nature VALUES ('PCA', 'Permis de construire comprenant ou non des démolitions');
1118    INSERT INTO nature VALUES ('AZ', 'Demande d''autorisation spéciale de travaux dans le périmètre d''une AVAP');
1119    INSERT INTO nature VALUES ('DAT', 'Demande d''autorisation de construire, d''aménager ou de modifier un ERP');
1120    
1121    ALTER TABLE dossier ALTER COLUMN dossier TYPE character varying(20);
1122    
1123    ALTER TABLE dossier ADD column dossier_autorisation character varying(20) NOT NULL;
1124    ALTER TABLE ONLY dossier
1125        ADD CONSTRAINT dossier_dossier_autorisation_fkey FOREIGN KEY (dossier_autorisation) REFERENCES dossier_autorisation(dossier_autorisation);
1126    
1127    ALTER TABLE instruction ALTER COLUMN dossier TYPE character varying(20);
1128    
1129    ALTER TABLE instruction ALTER COLUMN dossier TYPE character varying(20);
1130    ALTER TABLE consultation ALTER COLUMN dossier TYPE character varying(20);
1131    ALTER TABLE terrain ALTER COLUMN dossier TYPE character varying(20);
1132    ALTER TABLE blocnote ALTER COLUMN dossier TYPE character varying(20);
1133    ALTER TABLE destination_shon ALTER COLUMN dossier TYPE character varying(20);
1134    ALTER TABLE statistique ALTER COLUMN dossier TYPE character varying(20);
1135    
1136    INSERT INTO om_parametre VALUES (nextval('om_parametre_seq'), 'option_ERP', 'true', 1);
1137    INSERT INTO om_parametre VALUES (nextval('om_parametre_seq'), 'option_GED', 'false', 1);

Legend:
Removed from v.915  
changed lines
  Added in v.947

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26