CREATE DATABASE `gboard` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
CREATE TABLE `especificacion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_objetivo` int(11) NOT NULL,
  `descripcion` varchar(250) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `estatus` varchar(50) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `unidad` varchar(94) DEFAULT NULL,
  `medida` int(94) DEFAULT NULL,
  `ubicacion` varchar(300) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `colaborador` int(11) DEFAULT NULL,
  `fecha_creado` date DEFAULT NULL,
  `hora_creado` time NOT NULL,
  `runner` int(11) DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `hora_fin` time DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id_objetivo` (`id_objetivo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE `resources` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` text NOT NULL,
  `link` text NOT NULL,
  `tipo` varchar(10) NOT NULL,
  `actividad` int(11) NOT NULL,
  `status` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `actividad` (`actividad`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;

CREATE TABLE `actividad` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `descripcion` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `estatus` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `tiempo` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `entregable` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `from` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `para` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `obstaculos` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `fecha` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `topico` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `lab` varchar(140) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `prioridad` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `categoria` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL DEFAULT 'Cliente',
  `hour` varchar(16) NOT NULL,
  `date1` date NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `puesto` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(50) NOT NULL,
  `colaborador` varchar(150) NOT NULL,
  `cuenta_asociada` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `colaborador` (`colaborador`)
) ENGINE=InnoDB AUTO_INCREMENT=1244 DEFAULT CHARSET=utf8;

CREATE TABLE `colaborador` (
  `wikiname` varchar(150) NOT NULL,
  `password` varchar(80) NOT NULL,
  `email` varchar(80) NOT NULL,
  `picture` text NOT NULL,
  `origen` int(11) NOT NULL,
  `type` varchar(15) NOT NULL DEFAULT 'manager',
  PRIMARY KEY (`wikiname`),
  KEY `origen` (`origen`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `stored_notification` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_actividad` int(11) DEFAULT NULL,
  `id_grupo` int(11) DEFAULT NULL,
  `target` int(11) NOT NULL,
  `colaborador` varchar(150) NOT NULL,
  `tipo` varchar(25) NOT NULL,
  `remitente` varchar(150) NOT NULL,
  `fecha` date NOT NULL,
  `hora` time NOT NULL,
  `estado` varchar(6) NOT NULL,
  `campo` varchar(20) NOT NULL,
  `last_value` varchar(300) NOT NULL,
  `new_value` varchar(300) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_actividad` (`id_actividad`),
  KEY `colaborador` (`colaborador`),
  KEY `remitente` (`remitente`),
  KEY `target` (`target`),
  KEY `id_grupo` (`id_grupo`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  CREATE TABLE `pap_sub_eje` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `titulo` varchar(80) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `descripcion` text CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci,
  `topico` varchar(350) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `estatus` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `avance` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `prioridad` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `fecha_inicio` date DEFAULT NULL,
  `fecha_fin` date DEFAULT NULL,
  `fecha_real` date DEFAULT NULL,
  `metrica` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `responsable_1` int(11) DEFAULT NULL,
  `responsable_2` int(11) DEFAULT NULL,
  `encargado_ahora` int(11) DEFAULT NULL,
  `padre` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci DEFAULT NULL,
  `eje` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `cuenta` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `hour` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci NOT NULL,
  `link` varchar(350) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci DEFAULT NULL,
  `estimacion` varchar(50) NOT NULL,
  `timing` varchar(3) NOT NULL,
  `posicion` int(11) NOT NULL,
  `next_step` varchar(150) NOT NULL,
  `type` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `responsable_1` (`responsable_1`),
  KEY `responsable_2` (`responsable_2`),
  KEY `encargado_ahora` (`encargado_ahora`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `calendar_google` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_act` int(11) NOT NULL,
  `id_user` int(11) NOT NULL,
  `id_evento` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `comentario` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `activity_id` int(11) DEFAULT NULL,
  `autor` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `comment` varchar(750) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `date` varchar(140) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `hour` time NOT NULL,
  `editado` tinyint(1) DEFAULT NULL,
  `id_entregable` int(11) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `id_respuesta` int(11) DEFAULT NULL,
  `tipo` varchar(20) DEFAULT NULL,
  `target` varchar(300) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activity_id` (`activity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `entregable_spec` (
  `id_spec` int(11) NOT NULL AUTO_INCREMENT,
  `id_actividad` int(11) NOT NULL,
  `id_original` int(11) NOT NULL,
  `spec_estatus` varchar(50) NOT NULL,
  PRIMARY KEY (`id_spec`),
  KEY `id_actividad` (`id_actividad`),
  KEY `id_original` (`id_original`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `comentario` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `activity_id` int(11) DEFAULT NULL,
  `autor` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `comment` varchar(750) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `date` varchar(140) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
  `hour` time NOT NULL,
  `editado` tinyint(1) DEFAULT NULL,
  `id_entregable` int(11) DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL,
  `id_respuesta` int(11) DEFAULT NULL,
  `tipo` varchar(20) DEFAULT NULL,
  `target` varchar(300) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activity_id` (`activity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `entregable` (
  `id_entregable` int(11) NOT NULL AUTO_INCREMENT,
  `id_ruta` int(11) NOT NULL,
  `id_original` int(11) NOT NULL,
  `id_actividad` int(11) NOT NULL,
  `actividad_resp1` int(11) NOT NULL,
  `actividad_resp2` int(11) NOT NULL,
  `actividad_resp3` int(11) NOT NULL,
  `actividad_estatus` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `ubicacion` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `fecha` date NOT NULL,
  `hora` time NOT NULL,
  `fecha_inicio` datetime NOT NULL,
  `fecha_fin` datetime NOT NULL,
  `semana` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `dia` varchar(3) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  PRIMARY KEY (`id_entregable`),
  KEY `id_ruta` (`id_ruta`),
  KEY `id_original` (`id_original`),
  KEY `id_actividad` (`id_actividad`),
  KEY `actividad_resp1` (`actividad_resp1`),
  KEY `actividad_resp2` (`actividad_resp2`),
  KEY `actividad_resp3` (`actividad_resp3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `entregable_comment` (
  `id_comment` int(11) NOT NULL AUTO_INCREMENT,
  `id_actividad` int(11) NOT NULL,
  PRIMARY KEY (`id_comment`),
  KEY `id_actividad` (`id_actividad`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `entregable_transformacion` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_actividad` int(11) NOT NULL,
  `titulo` varchar(50) NOT NULL,
  `tipo` varchar(15) NOT NULL,
  `liga` varchar(150) DEFAULT NULL,
  `contenido` varchar(500) DEFAULT NULL,
  `status` varchar(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `id_actividad` (`id_actividad`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;