--
-- Structure de la table `gdd_annotation`
--

CREATE TABLE `gdd_annotation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_demande` int(11) NOT NULL,
  `fkid_createur` varchar(32) NOT NULL,
  `date_creation` datetime NOT NULL,
  `annotation` text NOT NULL,
  `tous` varchar(1) NOT NULL DEFAULT 'N',
  `liste_groupe` text NOT NULL,
  `liste_user` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;

--
-- Structure de la table `gdd_annotation_user`
--

CREATE TABLE `gdd_annotation_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_destinataire` varchar(32) NOT NULL,
  `lu` varchar(1) NOT NULL DEFAULT 'N',
  `date_lecture` datetime NOT NULL,
  `fkid_annotation` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_autorise_user`
--

CREATE TABLE `gdd_autorise_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_user_proprietaire` varchar(32) NOT NULL,
  `fkid_user_autorise` varchar(32) NOT NULL,
  `date_creation` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_demande`
--

CREATE TABLE `gdd_demande` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `fkid_type_demande` int(11) NOT NULL,
  `annee` int(11) NOT NULL,
  `numero` int(11) NOT NULL,
  `fkid_courrier` int(11) NOT NULL,
  `date_creation` datetime NOT NULL,
  `titre_demande` varchar(255) NOT NULL,
  `fkid_quartier` int(11) NOT NULL,
  `fkid_elu_quartier` int(11) NOT NULL,
  `fkid_domaine` int(11) NOT NULL,
  `fkid_elu_domaine` int(11) NOT NULL,
  `numero_lieu_demande` varchar(10) NOT NULL,
  `rue` varchar(150) NOT NULL,
  `ville` varchar(250) NOT NULL,
  `code_postal` int(11) NOT NULL,
  `complement_adresse` varchar(255) NOT NULL,
  `description_demande` text NOT NULL,
  `fkid_user_createur` varchar(32) NOT NULL,
  `demande_cloturer` varchar(1) NOT NULL DEFAULT 'N',
  `date_cloture` datetime NOT NULL,
  `fkid_user_cloture` varchar(32) NOT NULL,
  `date_limite` date NOT NULL,
  `info_compl_demandeur` text NOT NULL,
  `fkid_etat` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_domaine`
--

CREATE TABLE `gdd_domaine` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(45) NOT NULL,
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_domaine_elu`
--

CREATE TABLE `gdd_domaine_elu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_domaine` int(11) NOT NULL,
  `fkid_elu` int(11) NOT NULL,
  `elu_principale` varchar(1) NOT NULL DEFAULT 'N',
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_domaine_groupe`
--

CREATE TABLE `gdd_domaine_groupe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_domaine` int(11) NOT NULL,
  `fkid_groupe` varchar(32) NOT NULL,
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_elu`
--

CREATE TABLE `gdd_elu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(45) NOT NULL,
  `prenom` varchar(45) NOT NULL,
  `statut` varchar(100) NOT NULL,
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_etat`
--

CREATE TABLE `gdd_etat` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(45) NOT NULL,
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_intervention`
--

CREATE TABLE `gdd_intervention` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_demande` int(11) NOT NULL,
  `fkid_groupe_emetteur` varchar(32) NOT NULL,
  `fkid_user_emetteur` varchar(32) NOT NULL,
  `fkid_groupe_destinataire` varchar(32) NOT NULL,
  `fkid_user_destinataire` varchar(32) NOT NULL,
  `fkid_user_cloture` varchar(32) NOT NULL,
  `description` text NOT NULL,
  `realisation` text NOT NULL,
  `reponse` text NOT NULL,
  `date_creation` datetime NOT NULL,
  `date_delai` date NOT NULL,
  `date_realisation` date NOT NULL,
  `date_cloture` datetime NOT NULL,
  `intervention_cloturer` varchar(1) NOT NULL DEFAULT 'N',
  `erreur_destination` varchar(1) NOT NULL DEFAULT 'N',
  `erreur_vue` varchar(1) NOT NULL DEFAULT 'N',
  `info_erreur_destination` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_inter_piece_jointe`
--

CREATE TABLE `gdd_inter_piece_jointe` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_intervention` int(11) NOT NULL,
  `type_fichier` varchar(5) NOT NULL,
  `nom_fichier` varchar(45) NOT NULL,
  `titre_fichier` varchar(255) NOT NULL,
  `fkid_user_createur` varchar(32) NOT NULL,
  `date_creation` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_quartier`
--

CREATE TABLE `gdd_quartier` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(45) NOT NULL,
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_quartier_elu`
--

CREATE TABLE `gdd_quartier_elu` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `fkid_quartier` int(11) NOT NULL,
  `fkid_elu` int(11) NOT NULL,
  `elu_principale` varchar(1) NOT NULL DEFAULT 'N',
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_rue`
--

CREATE TABLE `gdd_rue` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom_complet` varchar(150) NOT NULL,
  `objet` varchar(20) NOT NULL,
  `liaison` varchar(10) NOT NULL,
  `prenom` varchar(50) NOT NULL,
  `nom` varchar(50) NOT NULL,
  `fkid_ville` int(11) NOT NULL,
  `fkid_code_rue` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

--
-- Structure de la table `gdd_type_demande`
--

CREATE TABLE `gdd_type_demande` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `abreviation` varchar(5) NOT NULL,
  `nom` varchar(45) NOT NULL,
  `delai_reponse` int(11) NOT NULL DEFAULT '21',
  `actif` varchar(1) NOT NULL DEFAULT 'Y',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

