 CREATE TABLE IF NOT EXISTS `product` (
 `id_product` int(11) NOT NULL,
   `id_product_prestashop` int(11) NOT NULL,
-  `id_user` int(11) NOT NULL
+  `id_craft_shop` int(11) NOT NULL,
+  CONSTRAINT `fk_shop_id_product` FOREIGN KEY (`id_craft_shop`) REFERENCES `craftshop` (`id_craftshop`) ON DELETE NO ACTION ON UPDATE NO ACTION
 ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
 
 --
 -- Volcado de datos para la tabla `product`
 --
-
-INSERT INTO `product` (`id_product`, `id_product_prestashop`, `id_user`) VALUES
-(1, 22, 2),
-(2, 12, 4);
 
 -- --------------------------------------------------------
 

  `id_shop` int(10) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS craftshop(
    id_craftshop int not null auto_increment,
    name varchar(70),
    description varchar(255),
    PRIMARY KEY(id_craftshop)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE IF NOT EXISTS user_rol(

-- Estructura de tabla para la tabla `material`
--

CREATE TABLE IF NOT EXISTS craftshop(
    id_craftshop int not null auto_increment,
    name varchar(70),
    description varchar(255),
    PRIMARY KEY(id_craftshop)
)ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE IF NOT EXISTS `material` (
`id_material` int(10) NOT NULL,
  `id_craftshop` int(10) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `id_category` int(10) NOT NULL,
  `id_measurement` int(10) DEFAULT NULL,
  `price` double DEFAULT NULL,
   CONSTRAINT `fk_id_craftshop_material` FOREIGN KEY (`id_craftshop`) REFERENCES `craftshop` (`id_craftshop`) ON DELETE NO ACTION ON UPDATE NO ACTION

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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