--------------------------------------------------------------------------------
-- Script de mise à jour de la version 2.0.1 vers la version 2.0.2
--
-- Ce script est en cours de développement, il est nommé ver_2.0.2-dev.sql 
-- jusqu'à la release de cette version pour laquelle il devra être renommé
-- en ver_2.0.2.sql
--
-- @package openscrutin
-- @version SVN : $Id$
-------------------------------------------------------------------------------

-- Correction des séquences - Ticket #7286
ALTER SEQUENCE affectation_seq OWNED BY affectation.affectation;
ALTER SEQUENCE candidat_seq OWNED BY candidat.candidat;
ALTER SEQUENCE candidature_seq OWNED BY candidature.candidature;
ALTER SEQUENCE elu_seq OWNED BY elu.elu;
ALTER SEQUENCE om_collectivite_seq OWNED BY om_collectivite.om_collectivite;
ALTER SEQUENCE om_etat_seq OWNED BY om_etat.om_etat;
ALTER SEQUENCE om_lettretype_seq OWNED BY om_lettretype.om_lettretype;
ALTER SEQUENCE om_sig_map_comp_seq OWNED BY om_sig_map_comp.om_sig_map_comp;
ALTER SEQUENCE om_sig_map_seq OWNED BY om_sig_map.om_sig_map;
ALTER SEQUENCE om_sig_map_wms_seq OWNED BY om_sig_map_wms.om_sig_map_wms;
ALTER SEQUENCE om_sig_wms_seq OWNED BY om_sig_wms.om_sig_wms;
ALTER SEQUENCE om_sousetat_seq OWNED BY om_sousetat.om_sousetat;
ALTER SEQUENCE om_tdb_seq OWNED BY om_tdb.om_tdb;
ALTER SEQUENCE om_widget_seq OWNED BY om_widget.om_widget;

-- Suppression des états, sous-états et lettres type provenant du framework
DELETE from om_etat WHERE id='om_collectivite';
DELETE from om_sousetat WHERE id='om_parametre.om_collectivite';
DELETE from om_lettretype WHERE id='om_utilisateur';

-- Suppression des permissions pour les requêtes mémorisées et les éditions qui
-- ne sont pas utilisées
DELETE FROM om_droit WHERE libelle='edition' or libelle='reqmo';

