-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Dim 26 Mai 2013 à 15:46
-- Version du serveur: 5.1.69
-- Version de PHP: 5.3.2-1ubuntu4.19


--
-- Base de données: `mtweb`
--

-- --------------------------------------------------------

--
-- Structure de la table `mw_actions_roles`
--

CREATE TABLE IF NOT EXISTS `mw_actions_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `action` varchar(255) NOT NULL,
  `id_role` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_role` (`id_role`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;

--
-- Contenu de la table `mw_actions_roles`
--

INSERT INTO `mw_actions_roles` (`id`, `action`, `id_role`) VALUES
(13, 'admin', 1),
(14, 'users', 2),
(19, 'users/identification', 0),
(20, 'config', 3);

-- --------------------------------------------------------

--
-- Structure de la table `mw_roles`
--

CREATE TABLE IF NOT EXISTS `mw_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(255) NOT NULL,
  `intitule` varchar(255) NOT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

--
-- Contenu de la table `mw_roles`
--

INSERT INTO `mw_roles` (`id`, `nom`, `intitule`) VALUES
(0, 'guest', 'invité'),
(1, 'admin', 'administrateur'),
(2, 'membre', 'membre'),
(3, 'webmaster', 'webmaster');

-- --------------------------------------------------------

--
-- Structure de la table `mw_users_roles`
--

CREATE TABLE IF NOT EXISTS `mw_users_roles` (
  `id_user` int(11) NOT NULL,
  `id_role` int(11) NOT NULL,
  PRIMARY KEY (`id_user`,`id_role`),
  KEY `id_role` (`id_role`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `mw_users_roles`
--

INSERT INTO `mw_users_roles` (`id_user`, `id_role`) VALUES
(19, 1),
(19, 2),
(19, 3);

--
-- Contraintes pour les tables exportées
--
-- DECOMMENTER POUR AJOUTER LES CONTRAINTES

--
-- Contraintes pour la table `mw_actions_roles`
--
-- ALTER TABLE `mw_actions_roles`
--   ADD CONSTRAINT `mw_actions_roles_ibfk_1` FOREIGN KEY (`id_role`) REFERENCES `mw_roles` (`id`);

--
-- Contraintes pour la table `mw_users_roles`
--
-- ALTER TABLE `mw_users_roles`
--   ADD CONSTRAINT `mw_users_roles_ibfk_1` FOREIGN KEY (`id_user`) REFERENCES `mw_users` (`id`),
--   ADD CONSTRAINT `mw_users_roles_ibfk_2` FOREIGN KEY (`id_role`) REFERENCES `mw_roles` (`id`);
