/[openfoncier]/branches/lien-openaria/data/pgsql/v3.28.0.sql
ViewVC logotype

Contents of /branches/lien-openaria/data/pgsql/v3.28.0.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4192 - (show annotations)
Wed May 18 09:51:39 2016 UTC (8 years, 8 months ago) by fmichon
File size: 19694 byte(s)
* Rebase

1 --
2 -- START / Développement - Notification pièces numérisées / Ajout d'un message
3 --
4
5 -- Ajout du champ categorie pour la table dossier_message
6 ALTER TABLE dossier_message ADD COLUMN categorie character varying(60);
7 COMMENT ON COLUMN dossier_message.categorie IS 'Carégorie du message (interne ou externe)';
8
9 -- Augmentation de la taille du champ emetteur pour la table dossier_message
10 ALTER TABLE dossier_message ALTER emetteur TYPE character varying(63);
11
12 -- Ajout de l'option pour ajouter un message à l'ajout d'une pièce numérisé
13 INSERT INTO om_parametre (om_parametre, libelle, valeur, om_collectivite)
14 SELECT nextval('om_parametre_seq'), 'option_notification_piece_numerisee', 'true', (SELECT om_collectivite FROM om_collectivite WHERE niveau = '2')
15 WHERE
16 NOT EXISTS (
17 SELECT om_parametre FROM om_parametre WHERE libelle = 'option_notification_piece_numerisee'
18 );
19
20 --
21 -- END / Développement - Notification pièces numérisées / Ajout d'un message
22 --
23
24 --
25 -- START - Evolution Filtre Paramétrable Widget 'Retours de messages'
26 --
27 --
28 UPDATE om_widget SET lien='messages_retours' WHERE lien='messages_mes_retours';
29 --
30 INSERT INTO om_droit (om_droit, libelle, om_profil)
31 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR')
32 WHERE
33 NOT EXISTS (
34 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR')
35 );
36 INSERT INTO om_droit (om_droit, libelle, om_profil)
37 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='DIVISIONNAIRE')
38 WHERE
39 NOT EXISTS (
40 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'DIVISIONNAIRE')
41 );
42 INSERT INTO om_droit (om_droit, libelle, om_profil)
43 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='CHEF DE SERVICE')
44 WHERE
45 NOT EXISTS (
46 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'CHEF DE SERVICE')
47 );
48 INSERT INTO om_droit (om_droit, libelle, om_profil)
49 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='QUALIFICATEUR')
50 WHERE
51 NOT EXISTS (
52 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'QUALIFICATEUR')
53 );
54 INSERT INTO om_droit (om_droit, libelle, om_profil)
55 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='ADMINISTRATEUR FONCTIONNEL')
56 WHERE
57 NOT EXISTS (
58 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR FONCTIONNEL')
59 );
60 INSERT INTO om_droit (om_droit, libelle, om_profil)
61 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR SERVICE')
62 WHERE
63 NOT EXISTS (
64 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR SERVICE')
65 );
66 INSERT INTO om_droit (om_droit, libelle, om_profil)
67 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='ADMINISTRATEUR GENERAL')
68 WHERE
69 NOT EXISTS (
70 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR GENERAL')
71 );
72 INSERT INTO om_droit (om_droit, libelle, om_profil)
73 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR POLYVALENT COMMUNE')
74 WHERE
75 NOT EXISTS (
76 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT COMMUNE')
77 );
78 INSERT INTO om_droit (om_droit, libelle, om_profil)
79 SELECT nextval('om_droit_seq'), 'messages_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR POLYVALENT')
80 WHERE
81 NOT EXISTS (
82 SELECT om_droit FROM om_droit WHERE libelle = 'messages_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT')
83 );
84 --
85 -- END - Evolution Filtre Paramétrable Widget 'Retours de consultation'
86 --
87
88 --
89 -- START - Evolution CAPV - #114 — Mail aux communes
90 --
91
92 -- Ajout du paramètre objet du courriel pour la multicollectivité
93
94 INSERT INTO om_parametre (om_parametre, libelle, valeur, om_collectivite)
95 SELECT nextval('om_parametre_seq'),'param_courriel_de_notification_commune_objet_depuis_instruction', '[openADS] Notification de finalisation d''un événement d''instruction', (SELECT om_collectivite FROM om_collectivite WHERE niveau = '2')
96 WHERE
97 NOT EXISTS (
98 SELECT om_parametre FROM om_parametre WHERE libelle = 'param_courriel_de_notification_commune_objet_depuis_instruction' AND om_collectivite = (SELECT om_collectivite FROM om_collectivite WHERE niveau = '2')
99 );
100
101 -- Ajout du paramètre modèle du courriel pour la multicollectivité
102
103 INSERT INTO om_parametre (om_parametre, libelle, valeur, om_collectivite)
104 SELECT nextval('om_parametre_seq'),'param_courriel_de_notification_commune_modele_depuis_instruction', 'Bonjour,
105
106 Un nouvel événement d''instruction vient d''être finalisé concernant le dossier <DOSSIER_INSTRUCTION>. Le détail est disponible ici :
107 <URL_INSTRUCTION>
108
109 Cordialement.', (SELECT om_collectivite FROM om_collectivite WHERE niveau = '2')
110 WHERE
111 NOT EXISTS (
112 SELECT om_parametre FROM om_parametre WHERE libelle = 'param_courriel_de_notification_commune_modele_depuis_instruction' AND om_collectivite = (SELECT om_collectivite FROM om_collectivite WHERE niveau = '2')
113 );
114
115 -- Ajout du droit de notification aux profils
116
117 -- INSTRUCTEUR POLYVALENT
118 INSERT INTO om_droit (om_droit, libelle, om_profil)
119 SELECT nextval('om_droit_seq'),'instruction_notifier_commune',(SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT')
120 WHERE
121 NOT EXISTS (
122 SELECT om_droit FROM om_droit WHERE libelle = 'instruction_notifier_commune' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT')
123 );
124
125 -- ADMINISTRATEUR GENERAL
126 INSERT INTO om_droit (om_droit, libelle, om_profil)
127 SELECT nextval('om_droit_seq'),'instruction_notifier_commune',(SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR GENERAL')
128 WHERE
129 NOT EXISTS (
130 SELECT om_droit FROM om_droit WHERE libelle = 'instruction_notifier_commune' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR GENERAL')
131 );
132
133 --
134 -- END - Evolution CAPV - #114 — Mail aux communes
135 --
136
137 --
138 -- START - #459 — Des lignes de données techniques vides sans aucune liaison remplissent ~10% de la table
139 --
140
141 -- Suppression de la contrainte pour pouvoir dupliquer la ligne de données techniques, et
142 -- avoir temporairement 2 lignes liées au même DI.
143 ALTER TABLE "donnees_techniques"
144 DROP CONSTRAINT "donnees_techniques_dossier_instruction_unique";
145
146 -- Duplication des lignes de données techniques liées à un DA et un DI, en enlevant la
147 -- liaison au DA. La ligne copiée est donc liée au DI.
148 INSERT INTO donnees_techniques
149 SELECT
150 nextval('donnees_techniques_seq'),
151 dossier_instruction,
152 lot,
153 am_lotiss,
154 am_autre_div,
155 am_camping,
156 am_caravane,
157 am_carav_duree,
158 am_statio,
159 am_statio_cont,
160 am_affou_exhau,
161 am_affou_exhau_sup,
162 am_affou_prof,
163 am_exhau_haut,
164 am_coupe_abat,
165 am_prot_plu,
166 am_prot_muni,
167 am_mobil_voyage,
168 am_aire_voyage,
169 am_rememb_afu,
170 am_parc_resid_loi,
171 am_sport_moto,
172 am_sport_attrac,
173 am_sport_golf,
174 am_mob_art,
175 am_modif_voie_esp,
176 am_plant_voie_esp,
177 am_chem_ouv_esp,
178 am_agri_peche,
179 am_crea_voie,
180 am_modif_voie_exist,
181 am_crea_esp_sauv,
182 am_crea_esp_class,
183 am_projet_desc,
184 am_terr_surf,
185 am_tranche_desc,
186 am_lot_max_nb,
187 am_lot_max_shon,
188 am_lot_cstr_cos,
189 am_lot_cstr_plan,
190 am_lot_cstr_vente,
191 am_lot_fin_diff,
192 am_lot_consign,
193 am_lot_gar_achev,
194 am_lot_vente_ant,
195 am_empl_nb,
196 am_tente_nb,
197 am_carav_nb,
198 am_mobil_nb,
199 am_pers_nb,
200 am_empl_hll_nb,
201 am_hll_shon,
202 am_periode_exploit,
203 am_exist_agrand,
204 am_exist_date,
205 am_exist_num,
206 am_exist_nb_avant,
207 am_exist_nb_apres,
208 am_coupe_bois,
209 am_coupe_parc,
210 am_coupe_align,
211 am_coupe_ess,
212 am_coupe_age,
213 am_coupe_dens,
214 am_coupe_qual,
215 am_coupe_trait,
216 am_coupe_autr,
217 co_archi_recours,
218 co_cstr_nouv,
219 co_cstr_exist,
220 co_cloture,
221 co_elec_tension,
222 co_div_terr,
223 co_projet_desc,
224 co_anx_pisc,
225 co_anx_gara,
226 co_anx_veran,
227 co_anx_abri,
228 co_anx_autr,
229 co_anx_autr_desc,
230 co_tot_log_nb,
231 co_tot_ind_nb,
232 co_tot_coll_nb,
233 co_mais_piece_nb,
234 co_mais_niv_nb,
235 co_fin_lls_nb,
236 co_fin_aa_nb,
237 co_fin_ptz_nb,
238 co_fin_autr_nb,
239 co_fin_autr_desc,
240 co_mais_contrat_ind,
241 co_uti_pers,
242 co_uti_vente,
243 co_uti_loc,
244 co_uti_princ,
245 co_uti_secon,
246 co_resid_agees,
247 co_resid_etud,
248 co_resid_tourism,
249 co_resid_hot_soc,
250 co_resid_soc,
251 co_resid_hand,
252 co_resid_autr,
253 co_resid_autr_desc,
254 co_foyer_chamb_nb,
255 co_log_1p_nb,
256 co_log_2p_nb,
257 co_log_3p_nb,
258 co_log_4p_nb,
259 co_log_5p_nb,
260 co_log_6p_nb,
261 co_bat_niv_nb,
262 co_trx_exten,
263 co_trx_surelev,
264 co_trx_nivsup,
265 co_demont_periode,
266 co_sp_transport,
267 co_sp_enseign,
268 co_sp_act_soc,
269 co_sp_ouvr_spe,
270 co_sp_sante,
271 co_sp_culture,
272 co_statio_avt_nb,
273 co_statio_apr_nb,
274 co_statio_adr,
275 co_statio_place_nb,
276 co_statio_tot_surf,
277 co_statio_tot_shob,
278 co_statio_comm_cin_surf,
279 su_avt_shon1,
280 su_avt_shon2,
281 su_avt_shon3,
282 su_avt_shon4,
283 su_avt_shon5,
284 su_avt_shon6,
285 su_avt_shon7,
286 su_avt_shon8,
287 su_avt_shon9,
288 su_cstr_shon1,
289 su_cstr_shon2,
290 su_cstr_shon3,
291 su_cstr_shon4,
292 su_cstr_shon5,
293 su_cstr_shon6,
294 su_cstr_shon7,
295 su_cstr_shon8,
296 su_cstr_shon9,
297 su_trsf_shon1,
298 su_trsf_shon2,
299 su_trsf_shon3,
300 su_trsf_shon4,
301 su_trsf_shon5,
302 su_trsf_shon6,
303 su_trsf_shon7,
304 su_trsf_shon8,
305 su_trsf_shon9,
306 su_chge_shon1,
307 su_chge_shon2,
308 su_chge_shon3,
309 su_chge_shon4,
310 su_chge_shon5,
311 su_chge_shon6,
312 su_chge_shon7,
313 su_chge_shon8,
314 su_chge_shon9,
315 su_demo_shon1,
316 su_demo_shon2,
317 su_demo_shon3,
318 su_demo_shon4,
319 su_demo_shon5,
320 su_demo_shon6,
321 su_demo_shon7,
322 su_demo_shon8,
323 su_demo_shon9,
324 su_sup_shon1,
325 su_sup_shon2,
326 su_sup_shon3,
327 su_sup_shon4,
328 su_sup_shon5,
329 su_sup_shon6,
330 su_sup_shon7,
331 su_sup_shon8,
332 su_sup_shon9,
333 su_tot_shon1,
334 su_tot_shon2,
335 su_tot_shon3,
336 su_tot_shon4,
337 su_tot_shon5,
338 su_tot_shon6,
339 su_tot_shon7,
340 su_tot_shon8,
341 su_tot_shon9,
342 su_avt_shon_tot,
343 su_cstr_shon_tot,
344 su_trsf_shon_tot,
345 su_chge_shon_tot,
346 su_demo_shon_tot,
347 su_sup_shon_tot,
348 su_tot_shon_tot,
349 dm_constr_dates,
350 dm_total,
351 dm_partiel,
352 dm_projet_desc,
353 dm_tot_log_nb,
354 tax_surf_tot,
355 tax_surf,
356 tax_surf_suppr_mod,
357 tax_su_princ_log_nb1,
358 tax_su_princ_log_nb2,
359 tax_su_princ_log_nb3,
360 tax_su_princ_log_nb4,
361 tax_su_princ_log_nb_tot1,
362 tax_su_princ_log_nb_tot2,
363 tax_su_princ_log_nb_tot3,
364 tax_su_princ_log_nb_tot4,
365 tax_su_princ_surf1,
366 tax_su_princ_surf2,
367 tax_su_princ_surf3,
368 tax_su_princ_surf4,
369 tax_su_princ_surf_sup1,
370 tax_su_princ_surf_sup2,
371 tax_su_princ_surf_sup3,
372 tax_su_princ_surf_sup4,
373 tax_su_heber_log_nb1,
374 tax_su_heber_log_nb2,
375 tax_su_heber_log_nb3,
376 tax_su_heber_log_nb_tot1,
377 tax_su_heber_log_nb_tot2,
378 tax_su_heber_log_nb_tot3,
379 tax_su_heber_surf1,
380 tax_su_heber_surf2,
381 tax_su_heber_surf3,
382 tax_su_heber_surf_sup1,
383 tax_su_heber_surf_sup2,
384 tax_su_heber_surf_sup3,
385 tax_su_secon_log_nb,
386 tax_su_tot_log_nb,
387 tax_su_secon_log_nb_tot,
388 tax_su_tot_log_nb_tot,
389 tax_su_secon_surf,
390 tax_su_tot_surf,
391 tax_su_secon_surf_sup,
392 tax_su_tot_surf_sup,
393 tax_ext_pret,
394 tax_ext_desc,
395 tax_surf_tax_exist_cons,
396 tax_log_exist_nb,
397 tax_am_statio_ext,
398 tax_sup_bass_pisc,
399 tax_empl_ten_carav_mobil_nb,
400 tax_empl_hll_nb,
401 tax_eol_haut_nb,
402 tax_pann_volt_sup,
403 tax_am_statio_ext_sup,
404 tax_sup_bass_pisc_sup,
405 tax_empl_ten_carav_mobil_nb_sup,
406 tax_empl_hll_nb_sup,
407 tax_eol_haut_nb_sup,
408 tax_pann_volt_sup_sup,
409 tax_trx_presc_ppr,
410 tax_monu_hist,
411 tax_comm_nb,
412 tax_su_non_habit_surf1,
413 tax_su_non_habit_surf2,
414 tax_su_non_habit_surf3,
415 tax_su_non_habit_surf4,
416 tax_su_non_habit_surf5,
417 tax_su_non_habit_surf6,
418 tax_su_non_habit_surf7,
419 tax_su_non_habit_surf_sup1,
420 tax_su_non_habit_surf_sup2,
421 tax_su_non_habit_surf_sup3,
422 tax_su_non_habit_surf_sup4,
423 tax_su_non_habit_surf_sup5,
424 tax_su_non_habit_surf_sup6,
425 tax_su_non_habit_surf_sup7,
426 vsd_surf_planch_smd,
427 vsd_unit_fonc_sup,
428 vsd_unit_fonc_constr_sup,
429 vsd_val_terr,
430 vsd_const_sxist_non_dem_surf,
431 vsd_rescr_fisc,
432 pld_val_terr,
433 pld_const_exist_dem,
434 pld_const_exist_dem_surf,
435 code_cnil,
436 terr_juri_titul,
437 terr_juri_lot,
438 terr_juri_zac,
439 terr_juri_afu,
440 terr_juri_pup,
441 terr_juri_oin,
442 terr_juri_desc,
443 terr_div_surf_etab,
444 terr_div_surf_av_div,
445 doc_date,
446 doc_tot_trav,
447 doc_tranche_trav,
448 doc_tranche_trav_desc,
449 doc_surf,
450 doc_nb_log,
451 doc_nb_log_indiv,
452 doc_nb_log_coll,
453 doc_nb_log_lls,
454 doc_nb_log_aa,
455 doc_nb_log_ptz,
456 doc_nb_log_autre,
457 daact_date,
458 daact_date_chgmt_dest,
459 daact_tot_trav,
460 daact_tranche_trav,
461 daact_tranche_trav_desc,
462 daact_surf,
463 daact_nb_log,
464 daact_nb_log_indiv,
465 daact_nb_log_coll,
466 daact_nb_log_lls,
467 daact_nb_log_aa,
468 daact_nb_log_ptz,
469 daact_nb_log_autre,
470 NULL as dossier_autorisation,
471 am_div_mun,
472 co_perf_energ,
473 architecte,
474 co_statio_avt_shob,
475 co_statio_apr_shob,
476 co_statio_avt_surf,
477 co_statio_apr_surf,
478 co_trx_amgt,
479 co_modif_aspect,
480 co_modif_struct,
481 co_ouvr_elec,
482 co_ouvr_infra,
483 co_trx_imm,
484 co_cstr_shob,
485 am_voyage_deb,
486 am_voyage_fin,
487 am_modif_amgt,
488 am_lot_max_shob,
489 mod_desc,
490 tr_total,
491 tr_partiel,
492 tr_desc,
493 avap_co_elt_pro,
494 avap_nouv_haut_surf,
495 avap_co_clot,
496 avap_aut_coup_aba_arb,
497 avap_ouv_infra,
498 avap_aut_inst_mob,
499 avap_aut_plant,
500 avap_aut_auv_elec,
501 tax_dest_loc_tr,
502 ope_proj_desc,
503 tax_surf_tot_cstr,
504 cerfa,
505 tax_surf_loc_stat,
506 tax_su_princ_surf_stat1,
507 tax_su_princ_surf_stat2,
508 tax_su_princ_surf_stat3,
509 tax_su_princ_surf_stat4,
510 tax_su_secon_surf_stat,
511 tax_su_heber_surf_stat1,
512 tax_su_heber_surf_stat2,
513 tax_su_heber_surf_stat3,
514 tax_su_tot_surf_stat,
515 tax_su_non_habit_surf_stat1,
516 tax_su_non_habit_surf_stat2,
517 tax_su_non_habit_surf_stat3,
518 tax_su_non_habit_surf_stat4,
519 tax_su_non_habit_surf_stat5,
520 tax_su_non_habit_surf_stat6,
521 tax_su_non_habit_surf_stat7,
522 tax_su_parc_statio_expl_comm_surf,
523 tax_log_ap_trvx_nb,
524 tax_am_statio_ext_cr,
525 tax_sup_bass_pisc_cr,
526 tax_empl_ten_carav_mobil_nb_cr,
527 tax_empl_hll_nb_cr,
528 tax_eol_haut_nb_cr,
529 tax_pann_volt_sup_cr,
530 tax_surf_loc_arch,
531 tax_surf_pisc_arch,
532 tax_am_statio_ext_arch,
533 tax_empl_ten_carav_mobil_nb_arch,
534 tax_empl_hll_nb_arch,
535 tax_eol_haut_nb_arch,
536 ope_proj_div_co,
537 ope_proj_div_contr,
538 tax_desc,
539 erp_cstr_neuve,
540 erp_trvx_acc,
541 erp_extension,
542 erp_rehab,
543 erp_trvx_am,
544 erp_vol_nouv_exist,
545 erp_loc_eff1,
546 erp_loc_eff2,
547 erp_loc_eff3,
548 erp_loc_eff4,
549 erp_loc_eff5,
550 erp_loc_eff_tot,
551 erp_public_eff1,
552 erp_public_eff2,
553 erp_public_eff3,
554 erp_public_eff4,
555 erp_public_eff5,
556 erp_public_eff_tot,
557 erp_perso_eff1,
558 erp_perso_eff2,
559 erp_perso_eff3,
560 erp_perso_eff4,
561 erp_perso_eff5,
562 erp_perso_eff_tot,
563 erp_tot_eff1,
564 erp_tot_eff2,
565 erp_tot_eff3,
566 erp_tot_eff4,
567 erp_tot_eff5,
568 erp_tot_eff_tot,
569 erp_class_cat,
570 erp_class_type,
571 tax_surf_abr_jard_pig_colom,
572 tax_su_non_habit_abr_jard_pig_colom
573 FROM donnees_techniques
574 WHERE dossier_instruction NOTNULL AND dossier_autorisation NOTNULL;
575
576 -- On supprime la liaison au DI pour la ligne initiale, toujours liée au DA et au DI
577 UPDATE donnees_techniques SET dossier_instruction = NULL WHERE dossier_instruction NOTNULL AND dossier_autorisation NOTNULL;
578
579 -- Suppression des lignes vides
580 DELETE FROM donnees_techniques WHERE dossier_instruction IS NULL AND dossier_autorisation IS NULL;
581
582 -- Ré-application de la contrainte
583 ALTER TABLE "donnees_techniques"
584 ADD CONSTRAINT "donnees_techniques_dossier_instruction_unique" UNIQUE ("dossier_instruction");
585
586 --
587 -- END - #459 — Des lignes de données techniques vides sans aucune liaison remplissent ~10% de la table
588 --
589
590 --
591 -- START - Evolution Filtre Paramétrable Widget 'Retours de consultation'
592 --
593 --
594 UPDATE om_widget SET lien='consultation_retours' WHERE lien='consultation_mes_retours';
595 --
596 INSERT INTO om_droit (om_droit, libelle, om_profil)
597 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR')
598 WHERE
599 NOT EXISTS (
600 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR')
601 );
602 INSERT INTO om_droit (om_droit, libelle, om_profil)
603 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='DIVISIONNAIRE')
604 WHERE
605 NOT EXISTS (
606 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'DIVISIONNAIRE')
607 );
608 INSERT INTO om_droit (om_droit, libelle, om_profil)
609 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='CHEF DE SERVICE')
610 WHERE
611 NOT EXISTS (
612 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'CHEF DE SERVICE')
613 );
614 INSERT INTO om_droit (om_droit, libelle, om_profil)
615 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='QUALIFICATEUR')
616 WHERE
617 NOT EXISTS (
618 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'QUALIFICATEUR')
619 );
620 INSERT INTO om_droit (om_droit, libelle, om_profil)
621 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='ADMINISTRATEUR FONCTIONNEL')
622 WHERE
623 NOT EXISTS (
624 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR FONCTIONNEL')
625 );
626 INSERT INTO om_droit (om_droit, libelle, om_profil)
627 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR SERVICE')
628 WHERE
629 NOT EXISTS (
630 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR SERVICE')
631 );
632 INSERT INTO om_droit (om_droit, libelle, om_profil)
633 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='ADMINISTRATEUR GENERAL')
634 WHERE
635 NOT EXISTS (
636 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'ADMINISTRATEUR GENERAL')
637 );
638 INSERT INTO om_droit (om_droit, libelle, om_profil)
639 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR POLYVALENT COMMUNE')
640 WHERE
641 NOT EXISTS (
642 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT COMMUNE')
643 );
644 INSERT INTO om_droit (om_droit, libelle, om_profil)
645 SELECT nextval('om_droit_seq'), 'consultation_retours_ma_division', (SELECT om_profil FROM om_profil WHERE libelle='INSTRUCTEUR POLYVALENT')
646 WHERE
647 NOT EXISTS (
648 SELECT om_droit FROM om_droit WHERE libelle = 'consultation_retours_ma_division' AND om_profil = (SELECT om_profil FROM om_profil WHERE libelle = 'INSTRUCTEUR POLYVALENT')
649 );
650 --
651 -- END - Evolution Filtre Paramétrable Widget 'Retours de consultation'
652 --
653
654

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26