+
+DROP FOREIGN TABLE v1_compat.v_nomade_classes;
+IMPORT FOREIGN SCHEMA contactfaune FROM SERVER geonature1server INTO v1_compat;
+
+--create de vues métérialisées pour des raisons de performances
+CREATE MATERIALIZED VIEW v1_compat.vm_t_fiches_cf AS
+SELECT * FROM v1_compat.t_fiches_cf;
+CREATE MATERIALIZED VIEW v1_compat.vm_t_releves_cf AS
+SELECT * FROM v1_compat.t_releves_cf;
+
+
+--TODO : réactiver les triggers en prod
 ALTER TABLE pr_occtax.t_releves_occtax DISABLE TRIGGER USER;
 
 CREATE TABLE v1_compat.cor_critere_contactfaune_v1_to_v2 (

    the_geom_local AS geom_local,
    ST_TRANSFORM(the_geom_local, 4326) AS geom_4326,
    50 AS precision
FROM v1_compat.t_fiches_cf cf
LEFT JOIN n24 ON cf.id_lot = n24.pk_source;



ref_nomenclatures.get_id_nomenclature('TYP_DENBR', 'NSP'),
jeune AS count_min,
jeune AS count_max
FROM v1_compat.vm_t_releves_cf cf
WHERE jeune > 0;

INSERT INTO pr_occtax.cor_counting_occtax(
