37 |
|
|
38 |
UPDATE consultation SET service=(select service.service from service where service_old=service.service_old); |
UPDATE consultation SET service=(select service.service from service where service_old=service.service_old); |
39 |
|
|
|
ALTER TABLE service ADD COLUMN abrege varchar(70) NOT NULL default ''; |
|
40 |
ALTER TABLE service ADD COLUMN consultation_papier boolean; |
ALTER TABLE service ADD COLUMN consultation_papier boolean; |
41 |
ALTER TABLE service ADD COLUMN choix_consultation boolean; |
ALTER TABLE service ADD COLUMN notification_email boolean; |
42 |
ALTER TABLE service ADD COLUMN om_validite_debut date; |
ALTER TABLE service ADD COLUMN om_validite_debut date; |
43 |
ALTER TABLE service ADD COLUMN om_validite_fin date; |
ALTER TABLE service ADD COLUMN om_validite_fin date; |
44 |
|
ALTER TABLE service ADD COLUMN type_consultation varchar(70) NOT NULL DEFAULT 'avec_avis_attendu'; |
45 |
|
|
46 |
ALTER TABLE service DROP COLUMN service_old; |
ALTER TABLE service RENAME COLUMN service_old TO abrege; |
47 |
ALTER TABLE consultation DROP COLUMN service_old; |
ALTER TABLE consultation DROP COLUMN service_old; |
48 |
|
|
49 |
ALTER TABLE ONLY service |
ALTER TABLE ONLY service |
173 |
-- |
-- |
174 |
-- Modification de la table 'consultation' |
-- Modification de la table 'consultation' |
175 |
-- |
-- |
176 |
ALTER TABLE consultation ADD COLUMN motivation varchar(70) DEFAULT ''; |
ALTER TABLE consultation ADD COLUMN date_reception date; |
177 |
|
ALTER TABLE consultation ADD COLUMN motivation text DEFAULT ''; |
178 |
ALTER TABLE consultation ADD COLUMN fichier character varying(100); |
ALTER TABLE consultation ADD COLUMN fichier character varying(100); |
179 |
ALTER TABLE consultation ADD COLUMN lu boolean; |
ALTER TABLE consultation ADD COLUMN lu boolean; |
180 |
|
|
181 |
|
|
182 |
|
|
183 |
UPDATE evenement SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
UPDATE evenement SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
184 |
UPDATE instruction SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
UPDATE instruction SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
185 |
UPDATE dossier SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
UPDATE dossier SET avis_decision=(select avis_decision.avis_decision from avis_decision where avis=avis_decision.avis_old); |
200 |
ALTER TABLE avis_decision DROP COLUMN avis_old; |
ALTER TABLE avis_decision DROP COLUMN avis_old; |
201 |
ALTER TABLE avis_consultation DROP COLUMN avis_old; |
ALTER TABLE avis_consultation DROP COLUMN avis_old; |
202 |
DROP TABLE avis; |
DROP TABLE avis; |
203 |
|
|
204 |
|
-- |
205 |
|
-- Ajout des droits sur l'objet consultation_encours |
206 |
|
-- |
207 |
|
|
208 |
|
|
209 |
|
INSERT INTO om_widget VALUES (1, 1, 'Retours de consultations', '../scr/tab.php?obj=consultation_mes_retours', '<script type=''text/javascript''> |
210 |
|
$.ajax({ |
211 |
|
type: ''GET'', |
212 |
|
url:''../app/get_num_consult.php'', |
213 |
|
cache: false, |
214 |
|
success: function(html){ |
215 |
|
$(''#number_return'').append(html); |
216 |
|
} |
217 |
|
}); |
218 |
|
</script> |
219 |
|
<div id="number_return"></div>',2); |
220 |
|
|
221 |
|
-- |
222 |
|
-- Ajout des droits sur les nouvelles tables |
223 |
|
-- |
224 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'service_categorie', '4'); |
225 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'avis_decision', '4'); |
226 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'avis_consultation', '4'); |
227 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'lien_service_service_categorie', '4'); |
228 |
|
|
229 |
|
ALTER TABLE consultation ALTER service SET NOT NULL; |
230 |
|
ALTER TABLE dossier ADD COLUMN enjeu boolean; |
231 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_mes_retours', 4); |
232 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'consultation_tous_retours', 4); |
233 |
|
|
234 |
|
-- |
235 |
|
-- Modification de la structure des instructeurs |
236 |
|
-- |
237 |
|
CREATE SEQUENCE direction_seq |
238 |
|
START WITH 1 |
239 |
|
INCREMENT BY 1 |
240 |
|
NO MINVALUE |
241 |
|
NO MAXVALUE |
242 |
|
CACHE 1; |
243 |
|
|
244 |
|
CREATE TABLE direction ( |
245 |
|
direction integer NOT NULL, |
246 |
|
code character varying(20) NOT NULL, |
247 |
|
libelle character varying(40) NOT NULL, |
248 |
|
description text, |
249 |
|
chef character varying(30) NOT NULL, |
250 |
|
PRIMARY KEY (direction) |
251 |
|
); |
252 |
|
|
253 |
|
INSERT INTO direction VALUES (nextval('direction_seq'::regclass),'ADS', 'Direction ADS', 'Direction des autorisations des droits du sol', 'Mme Dupont'); |
254 |
|
|
255 |
|
CREATE SEQUENCE division_seq |
256 |
|
START WITH 1 |
257 |
|
INCREMENT BY 1 |
258 |
|
NO MINVALUE |
259 |
|
NO MAXVALUE |
260 |
|
CACHE 1; |
261 |
|
|
262 |
|
CREATE TABLE division ( |
263 |
|
division integer NOT NULL, |
264 |
|
code character varying(20) NOT NULL, |
265 |
|
libelle character varying(40) NOT NULL, |
266 |
|
description text, |
267 |
|
chef character varying(30) NOT NULL, |
268 |
|
direction integer NOT NULL, |
269 |
|
PRIMARY KEY (division), |
270 |
|
FOREIGN KEY ( direction ) REFERENCES direction ( direction ) |
271 |
|
); |
272 |
|
|
273 |
|
INSERT INTO division VALUES (nextval('division_seq'::regclass),'Defaut', 'Division par defaut', '', 'Mme Dupont',1); |
274 |
|
|
275 |
|
CREATE SEQUENCE instructeur_seq |
276 |
|
START WITH 1 |
277 |
|
INCREMENT BY 1 |
278 |
|
NO MINVALUE |
279 |
|
NO MAXVALUE |
280 |
|
CACHE 1; |
281 |
|
|
282 |
|
CREATE TABLE instructeur ( |
283 |
|
instructeur integer NOT NULL, |
284 |
|
nom character varying(30) NOT NULL, |
285 |
|
telephone character varying(14), |
286 |
|
division integer NOT NULL, |
287 |
|
om_utilisateur integer, |
288 |
|
PRIMARY KEY ( instructeur ), |
289 |
|
FOREIGN KEY ( division ) REFERENCES division ( division ), |
290 |
|
FOREIGN KEY ( om_utilisateur ) REFERENCES om_utilisateur ( om_utilisateur ) |
291 |
|
); |
292 |
|
|
293 |
|
-- Insertion des utilisateurs instructeurs dans la table instructeur |
294 |
|
INSERT INTO instructeur (instructeur,nom,telephone,division,om_utilisateur) |
295 |
|
(SELECT om_utilisateur,nom,telephone,1,om_utilisateur FROM om_utilisateur WHERE instructeur='Oui'); |
296 |
|
-- Mise a jour de la sequence |
297 |
|
SELECT setval('instructeur_seq',(SELECT MAX(instructeur) FROM instructeur)); |
298 |
|
|
299 |
|
-- Creation du parametre pour afficher ou non la division dans les dossiers |
300 |
|
INSERT INTO om_parametre VALUES (nextval('om_parametre_seq'::regclass),'afficher_division','false',1); |
301 |
|
|
302 |
|
-- Ajout des droits sur les tables d'organisation |
303 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'direction', '2'); |
304 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'division', '2'); |
305 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'instructeur', '2'); |
306 |
|
|
307 |
|
-- Modification de la clé étrangère dossier -> om_utilisateur par dossier -> instructeur |
308 |
|
ALTER TABLE dossier DROP CONSTRAINT dossier_instructeur_fkey; |
309 |
|
ALTER TABLE dossier ADD CONSTRAINT |
310 |
|
dossier_instructeur_fkey FOREIGN KEY (instructeur) REFERENCES instructeur(instructeur); |
311 |
|
|
312 |
|
-- Ajout des parametres des liens dans la table om_parametre |
313 |
|
INSERT INTO om_parametre VALUES (nextval('om_parametre_seq'::regclass),'lien_interne_vdm', '',1); |
314 |
|
INSERT INTO om_parametre VALUES (nextval('om_parametre_seq'::regclass),'lien_externe', '',1); |
315 |
|
ALTER TABLE om_parametre ALTER COLUMN valeur TYPE character varying(150); |
316 |
|
|
317 |
|
INSERT INTO om_droit VALUES (nextval('om_droit_seq'),'avis_code_barre', '2'); |