GRANT ALL PRIVILEGES ON *.* TO 'admin'@'127.0.0.1' IDENTIFIED BY 'admin' WITH GRANT OPTION;


CREATE DATABASE `pd` DEFAULT CHARACTER SET latin1 COLLATE latin1_spanish_ci;
USE `pd`;
--
-- Estructura de tabla para la tabla `authorities`
--
CREATE TABLE IF NOT EXISTS `authorities` (
  `USERNAME` varchar(45) NOT NULL,
  `AUTHORITY` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`USERNAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `authorities`
--

INSERT INTO `authorities` (`USERNAME`, `AUTHORITY`) VALUES
('alumn', 'alumno'),
('prof', 'profesor');

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

--
-- Estructura de tabla para la tabla `users`
--

CREATE TABLE IF NOT EXISTS `users` (
  `USERNAME` varchar(45) NOT NULL,
  `PASSWORD` varchar(45) DEFAULT NULL,
  `ENABLED` enum('true','false') DEFAULT 'true',
  `ruta` varchar(5000) NOT NULL DEFAULT 'C:\\\\Pfc/alumnos/',
  PRIMARY KEY (`USERNAME`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Volcado de datos para la tabla `users`
--

INSERT INTO `users` (`USERNAME`, `PASSWORD`, `ENABLED`, `ruta`) VALUES
('alumn', 'alumno', 'true', 'C:\\\\Pfc/alumnos/'),
('prof', 'profesor', 'true', '');


--
-- Filtros para la tabla `authorities`
--
ALTER TABLE `authorities`
  ADD CONSTRAINT `authorities_ibfk_1` FOREIGN KEY (`USERNAME`) REFERENCES `users` (`USERNAME`) ON DELETE CASCADE ON UPDATE CASCADE;

CREATE DATABASE `docencia` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
CREATE DATABASE `docencia1` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
CREATE DATABASE `docencia2` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
