-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------





--
-- Create schema bddwrjm
--

CREATE DATABASE /*!32312 IF NOT EXISTS*/ bddwrjm;
USE bddwrjm;

--
-- Structure for table `bddwrjm`.`characteristics`
--

CREATE TABLE  `bddwrjm`.`characteristics` (
  `id_characteristics` int(10) unsigned NOT NULL auto_increment,
  `characteristic` varchar(45) NOT NULL,
  PRIMARY KEY  (`id_characteristics`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bddwrjm`.`characteristics`
--

INSERT INTO `bddwrjm`.`characteristics` (`id_characteristics`,`characteristic`) VALUES 
 (1,'Black'),
 (2,'White');


--
-- Structure for table `bddwrjm`.`permissions`
--

CREATE TABLE  `bddwrjm`.`permissions` (
  `id_permission` int(10) unsigned NOT NULL auto_increment,
  `permission` varchar(45) NOT NULL,
  PRIMARY KEY  (`id_permission`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `bddwrjm`.`permissions`
--

INSERT INTO `bddwrjm`.`permissions` (`id_permission`,`permission`) VALUES 
 (1,'Insert'),
 (2,'Update'),
 (3,'Delete'),
 (4,'Search'),
 (5,'View'),
 (6,'Send');


--
-- Structure for table `bddwrjm`.`user_permi`
--

CREATE TABLE  `bddwrjm`.`user_permi` (
  `id_user_permi` int(11) NOT NULL auto_increment,
  `id` int(10) unsigned NOT NULL,
  `id_permission` int(10) unsigned NOT NULL,
  PRIMARY KEY  (`id_user_permi`),
  KEY `FK_user_permi_1` (`id`),
  KEY `FK_user_permi_2` (`id_permission`),
  CONSTRAINT `FK_user_permi_1` FOREIGN KEY (`id`) REFERENCES `users` (`id`),
  CONSTRAINT `FK_user_permi_2` FOREIGN KEY (`id_permission`) REFERENCES `permissions` (`id_permission`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 8192 kB; (`id`) REFER ` bddwrjm/usuario`(`id`);';

--
-- Dumping data for table `bddwrjm`.`user_permi`
--

INSERT INTO `bddwrjm`.`user_permi` (`id_user_permi`,`id`,`id_permission`) VALUES 
 (1,1,1),
 (2,1,2),
 (3,1,3),
 (4,1,4),
 (5,1,5),
 (6,2,3),
 (7,2,4),
 (8,3,2),
 (9,3,5),
 (10,1,6);

