-- --------------------------------------------------------
-- Servidor:                     127.0.0.1
-- Versão do servidor:           10.4.32-MariaDB - mariadb.org binary distribution
-- OS do Servidor:               Win64
-- HeidiSQL Versão:              12.6.0.6765
-- --------------------------------------------------------



-- Copiando estrutura do banco de dados para yms
CREATE DATABASE IF NOT EXISTS `yms` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */;
USE `yms`;

-- Copiando estrutura para tabela yms.trucks
CREATE TABLE IF NOT EXISTS `trucks` (
  `id` int(6) unsigned NOT NULL AUTO_INCREMENT,
  `plate_number` varchar(30) NOT NULL,
  `carrier` varchar(50) NOT NULL,
  `driver_name` varchar(50) NOT NULL,
  `arrival_time` timestamp NOT NULL DEFAULT current_timestamp(),
  `status` varchar(50) NOT NULL DEFAULT 'Aguardando entrada',
  `entry_authorized_time` timestamp NULL DEFAULT NULL,
  `entry_authorized_by` varchar(50) DEFAULT NULL,
  `entry_weighed_time` timestamp NULL DEFAULT NULL,
  `entry_weighed_by` varchar(50) DEFAULT NULL,
  `loading_started_time` timestamp NULL DEFAULT NULL,
  `loading_started_by` varchar(50) DEFAULT NULL,
  `loading_completed_time` timestamp NULL DEFAULT NULL,
  `loading_completed_by` varchar(50) DEFAULT NULL,
  `exit_weighed_time` timestamp NULL DEFAULT NULL,
  `exit_weighed_by` varchar(50) DEFAULT NULL,
  `exit_authorized_time` timestamp NULL DEFAULT NULL,
  `exit_authorized_by` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- Copiando dados para a tabela yms.trucks: ~2 rows (aproximadamente)
INSERT INTO `trucks` (`id`, `plate_number`, `carrier`, `driver_name`, `arrival_time`, `status`, `entry_authorized_time`, `entry_authorized_by`, `entry_weighed_time`, `entry_weighed_by`, `loading_started_time`, `loading_started_by`, `loading_completed_time`, `loading_completed_by`, `exit_weighed_time`, `exit_weighed_by`, `exit_authorized_time`, `exit_authorized_by`) VALUES
	(11, 'MNV0101', 'VIVER LU', 'PAULINHO', '2024-12-12 06:59:32', 'Caminhao liberado saida', '2024-12-12 06:59:59', 'Expedicao', '2024-12-12 07:03:03', 'Balanca', '2024-12-12 07:04:33', 'Expedicao', '2024-12-12 07:08:15', 'Expedicao', '2024-12-12 07:10:03', 'Balanca', '2024-12-12 07:12:18', 'Portaria'),
	(12, 'MNB0909', 'VIVER LU', 'PAULINHO', '2024-12-12 18:16:27', 'Pesagem Entrada OK', '2024-12-12 18:17:13', 'Expedicao', '2024-12-12 18:17:50', 'Balanca', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

