/[openfoncier]/trunk/data/pgsql/ver_3.00.sql
ViewVC logotype

Annotation of /trunk/data/pgsql/ver_3.00.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 268 - (hide annotations)
Thu Dec 8 09:14:00 2011 UTC (13 years, 2 months ago) by fraynaud
File size: 4249 byte(s)
correction de divers bugs suite mise en place operationnelle
mise a niveau des scripts data sql



1 fraynaud 119 -- ver 3.00
2 fraynaud 134 -- ce script contient les modifications de la base version 2.xx
3 fraynaud 119
4 fraynaud 268 -- schema
5     -- SET search_path = openfoncier, pg_catalog;
6 fraynaud 134
7 fraynaud 268
8     -- table action = parametrage en dehors du script
9    
10 fraynaud 119 ALTER TABLE action ADD regle_etat VARCHAR( 60 );
11     ALTER TABLE action ADD regle_delai VARCHAR( 60 );
12     ALTER TABLE action ADD regle_accord_tacite VARCHAR( 60 );
13     ALTER TABLE action ADD regle_avis VARCHAR( 60 );
14     ALTER TABLE action ADD regle_date_limite VARCHAR( 60 );
15     ALTER TABLE action ADD regle_date_notification_delai VARCHAR( 60 );
16     ALTER TABLE action ADD regle_date_complet VARCHAR( 60 );
17     ALTER TABLE action ADD regle_date_validite VARCHAR( 60 );
18     ALTER TABLE action ADD regle_date_decision VARCHAR( 60 );
19     ALTER TABLE action ADD regle_date_chantier VARCHAR( 60 );
20     ALTER TABLE action ADD regle_date_achevement VARCHAR( 60 );
21     ALTER TABLE action ADD regle_date_conformite VARCHAR( 60 );
22     ALTER TABLE action ADD regle_date_rejet VARCHAR( 60 );
23 fraynaud 127
24 fraynaud 256 -- dossier servitude et description
25 fraynaud 127
26     ALTER TABLE dossier ADD servitude text;
27 fraynaud 256 ALTER TABLE dossier ADD description text;
28 fraynaud 142 ALTER TABLE dossier ADD parcelle_lot integer;
29     ALTER TABLE dossier ADD parcelle_lot_lotissement varchar(60) not null default '';
30 fraynaud 147
31     -- parcelle
32     alter table parcelle drop sig;
33    
34 fraynaud 134 -- creation de tables servitude_surfacique, servitude_ligne, servitude_point
35 fraynaud 127
36 fraynaud 134 CREATE TABLE servitude_surfacique (
37     servitude_surfacique integer,
38     libelle varchar(20),
39     observation varchar(80),
40 fraynaud 152 perimetre integer,
41     description text,
42 fraynaud 134 PRIMARY KEY (servitude_surfacique)
43     );
44    
45     CREATE TABLE servitude_ligne (
46     servitude_ligne integer,
47     libelle varchar(20),
48     observation varchar(80),
49 fraynaud 152 perimetre integer,
50     description text,
51 fraynaud 134 PRIMARY KEY (servitude_ligne)
52     );
53    
54     CREATE TABLE servitude_point (
55     servitude_point integer,
56     libelle varchar(20),
57     observation varchar(80),
58 fraynaud 152 perimetre integer,
59     description text,
60 fraynaud 134 PRIMARY KEY (servitude_point)
61 fraynaud 152
62    
63 fraynaud 142 CREATE TABLE parcelle_lot (
64     parcelle_lot integer,
65     lotissement varchar(50),
66     numero varchar(16),
67     surface numeric(10,3),
68     PRIMARY KEY (servitude_point)
69     );
70    
71 fraynaud 134 -- creation des sequences servitude_surfacique, servitude_ligne, servitude_point
72    
73     CREATE SEQUENCE servitude_surfacique_seq
74     INCREMENT 1
75     MINVALUE 1
76     MAXVALUE 9223372036854775807
77     START 1
78     CACHE 1;
79    
80     CREATE SEQUENCE servitude_ligne_seq
81     INCREMENT 1
82     MINVALUE 1
83     MAXVALUE 9223372036854775807
84     START 1
85     CACHE 1;
86    
87     CREATE SEQUENCE servitude_point_seq
88     INCREMENT 1
89     MINVALUE 1
90     MAXVALUE 9223372036854775807
91     START 1
92     CACHE 1;
93 fraynaud 142
94     CREATE SEQUENCE parcelle_lot_seq
95     INCREMENT 1
96     MINVALUE 1
97     MAXVALUE 9223372036854775807
98     START 1
99 fraynaud 168 CACHE 1;
100    
101    
102    
103 fraynaud 268 -- creation table statistique pour sitadel
104 fraynaud 168
105     CREATE TABLE statistique(
106     statistique integer NOT NULL,
107     parametre varchar(20) NOT NULL,
108     valeur varchar(50) NOT NULL,
109     dossier varchar(12) NOT NULL,
110     PRIMARY KEY (statistique)
111     );
112    
113     CREATE TABLE parametre(
114     parametre varchar(20) NOT NULL,
115 fraynaud 170 libelle varchar(50) NOT NULL,
116 fraynaud 168 actif char(3) NOT NULL,
117     sitadel char(3),
118 fraynaud 170 longueur_champ integer,
119     type_champ varchar(20),
120 fraynaud 196 valeur_autorisee varchar(50),
121 fraynaud 168 PRIMARY KEY (parametre)
122     );
123    
124     CREATE SEQUENCE statistique_seq
125     INCREMENT 1
126     MINVALUE 1
127     MAXVALUE 9223372036854775807
128     START 1
129     CACHE 1;
130    
131    
132     ALTER TABLE ONLY statistique
133     ADD CONSTRAINT statistique_parametre_fkey FOREIGN KEY (parametre) REFERENCES parametre(parametre);
134    
135     ALTER TABLE ONLY statistique
136     ADD CONSTRAINT statistique_dossier_fkey FOREIGN KEY (dossier) REFERENCES dossier(dossier);
137    
138     -- destination shon
139    
140     ALTER TABLE destination_shon ADD shon_anterieure float;
141     ALTER TABLE destination_shon ADD shon_demolie float;
142     ALTER TABLE destination_shon ADD shon_anterieure_supprimee float;
143     ALTER TABLE destination_shon ADD shon_nouvelle_transformee float;
144     ALTER TABLE destination_shon ADD shon_nouvelle float;
145     ALTER TABLE destination_shon ADD shon_shob_transformee float;
146    
147    
148 fraynaud 268 -- travaux mise solde a Non si vide -> obligatoire dans le choix travaux en maj
149     update travaux set solde = 'Non' where solde = '';
150    
151     -- parametre nature = T Obligatoire pour evenement, travaux et bible
152     INSERT INTO nature VALUES ('T', 'Toutes');
153    
154     -- atreal
155     INSERT INTO om_profil VALUES (99, 'NON UTILISE');
156     INSERT INTO om_droit VALUES ('directory', 99);
157    
158     -- version
159     INSERT INTO om_version (om_version) VALUES ('3.0.0-b2');

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26