--
-- Host: localhost    Database: teste_inventario
-- ------------------------------------------------------


--
-- Table structure for table `bap_menu`
--

CREATE TABLE `bap_menu` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_by` int(11) NOT NULL DEFAULT '1',
  `url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `label` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `icon` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `permission` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `section` int(11) NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `dont_translate` tinyint(1) DEFAULT NULL,
  `visibility` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



CREATE TABLE IF NOT EXISTS `company_status` (
  `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  `company_id` int(10) UNSIGNED NOT NULL,
  `status_id` int(10) UNSIGNED NOT NULL,
  PRIMARY KEY (`id`),
  KEY `company_status_company_id_foreign` (`company_id`),
  KEY `company_status_status_id_foreign` (`status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `bap_menu`
--

INSERT INTO `bap_menu` VALUES (1,1,'/dashboard','home','apps','',NULL,1,'2018-09-16 05:58:14',NULL,0,1),(2,9,'/settings','settings','settings','settings.access',NULL,1,'2018-09-16 05:58:14','2018-11-23 12:59:37',0,1),(3,2,'/companies','companies','settings','companies.browse',NULL,1,'2018-09-16 05:58:50','2018-09-16 05:59:11',0,1),(4,5,'/clients','clients','settings','clients.browse',NULL,1,'2018-09-16 05:59:16','2018-09-16 05:59:38',0,1),(5,4,'/suppliers','suppliers','settings','suppliers.browse',NULL,1,'2018-09-16 05:59:44','2018-09-16 06:00:03',0,1),(6,10,'/users','users','settings','users.browse',NULL,1,'2018-09-16 19:20:18','2018-11-23 12:59:37',0,1),(7,3,'/places','places','settings','places.browse',NULL,1,'2018-09-17 16:24:50','2018-09-18 02:40:19',0,1),(8,6,'/collaborators','collaborators','settings','collaborators.browse',NULL,1,'2018-09-19 16:14:53','2018-11-23 12:57:51',0,1),(9,7,'/assets','assets','settings','assets.browse',NULL,1,'2018-09-22 02:23:18','2018-11-23 12:57:51',0,1),(10,8,'/reports','reports','settings','',NULL,1,'2018-10-10 01:33:32','2018-11-23 12:59:37',0,1),(11,1,'/reports','General Report','settings','',10,1,'2018-11-23 12:56:45','2018-11-23 12:57:51',0,1),(12,2,'/reports/conservationstate','Conservation State Report','settings','',10,1,'2018-11-23 12:58:11','2018-11-23 12:58:59',0,1),(13,3,'/reports/costs','Costs Report','settings','',10,1,'2018-11-23 12:59:05','2018-11-23 13:00:02',0,1);

--
-- Table structure for table `roles`
--

CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `display_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `roles`
--

INSERT INTO `roles` VALUES (1,'Admin','admin','web','2018-09-16 05:58:15','2018-09-16 05:58:15'),(2,'Chefe de inventário','chefe','web','2018-09-16 05:58:15','2018-09-16 05:58:15'),(3,'Gerente local','gerente','web','2018-09-16 05:58:15','2018-09-16 05:58:15');

--
-- Table structure for table `permissions`
--

CREATE TABLE `permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `perm_group` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `permissions`
--

INSERT INTO `permissions` VALUES (1,'clients.settings','web','2018-09-14 01:51:18','2018-09-14 01:51:18','Clients'),(2,'clients.browse','web','2018-09-14 01:51:18','2018-09-14 01:51:18','Clients'),(3,'clients.create','web','2018-09-14 01:51:18','2018-09-14 01:51:18','Clients'),(4,'clients.update','web','2018-09-14 01:51:18','2018-09-14 01:51:18','Clients'),(5,'clients.destroy','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Clients'),(6,'companies.settings','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Companies'),(7,'companies.browse','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Companies'),(8,'companies.create','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Companies'),(9,'companies.update','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Companies'),(10,'companies.destroy','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Companies'),(11,'suppliers.settings','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Suppliers'),(12,'suppliers.browse','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Suppliers'),(13,'suppliers.create','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Suppliers'),(14,'suppliers.update','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Suppliers'),(15,'suppliers.destroy','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Suppliers'),(16,'settings.access','web','2018-09-14 01:51:19','2018-09-14 01:51:19','Settings'),(17,'users.settings','web',NULL,NULL,'Users'),(18,'users.browse','web',NULL,NULL,'Users'),(19,'users.create','web',NULL,NULL,'Users'),(20,'users.update','web',NULL,NULL,'Users'),(21,'users.destroy','web',NULL,NULL,'Users'),(22,'places.settings','web',NULL,NULL,'Places'),(23,'places.browse','web',NULL,NULL,'Places'),(24,'places.create','web',NULL,NULL,'Places'),(25,'places.update','web',NULL,NULL,'Places'),(26,'places.destroy','web',NULL,NULL,'Places'),(27,'places.settings','web',NULL,NULL,'Places'),(28,'collaborators.settings','web',NULL,NULL,'Collaborators'),(29,'collaborators.browse','web',NULL,NULL,'Collaborators'),(30,'collaborators.create','web',NULL,NULL,'Collaborators'),(31,'collaborators.update','web',NULL,NULL,'Collaborators'),(32,'collaborators.destroy','web',NULL,NULL,'Collaborators'),(33,'collaborators.settings','web',NULL,NULL,'Collaborators'),(34,'areas.browse','web',NULL,NULL,'Areas'),(35,'areas.create','web',NULL,NULL,'Areas'),(36,'areas.update','web',NULL,NULL,'Areas'),(37,'areas.destroy','web',NULL,NULL,'Areas'),(38,'assets.browse','web',NULL,NULL,'Assets'),(39,'assets.create','web',NULL,NULL,'Assets'),(40,'assets.update','web',NULL,NULL,'Assets'),(41,'assets.destroy','web',NULL,NULL,'Assets'),(42,'assets.settings','web',NULL,NULL,'Assets'),
(43, 'maintenances.settings', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Maintenances'),
(44, 'maintenances.browse', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Maintenances'),
(45, 'maintenances.create', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Maintenances'),
(46, 'maintenances.update', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Maintenances'),
(47, 'maintenances.destroy', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Maintenances'),
(48, 'reports.settings', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Reports'),
(49, 'reports.browse', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Reports'),
(50, 'reports.create', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Reports'),
(51, 'reports.update', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Reports'),
(52, 'reports.destroy', 'web', '2019-01-16 17:19:48', '2019-01-16 17:19:48', 'Reports');


--
-- Table structure for table `role_has_permissions`
--

CREATE TABLE `role_has_permissions` (
  `permission_id` int(10) unsigned NOT NULL,
  `role_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`role_id`),
  KEY `role_has_permissions_role_id_foreign` (`role_id`),
  CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_has_permissions`
--

INSERT INTO `role_has_permissions` VALUES (1,1),(1,2),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3),(5,1),(5,2),(5,3),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(11,2),(12,1),(12,2),(12,3),(13,1),(13,2),(13,3),(14,1),(14,2),(14,3),(15,1),(15,2),(15,3),(16,1),(17,2),(18,2),(19,2),(20,2),(21,2),(22,1),(22,2),(23,1),(23,2),(24,1),(24,2),(25,1),(25,2),(26,1),(26,2),(27,1),(27,2),(28,1),(28,2),(29,1),(29,2),(29,3),(30,1),(30,2),(30,3),(31,1),(31,2),(31,3),(32,1),(32,2),(32,3),(38,1),(38,2),(38,3),(39,1),(39,2),(39,3),(40,1),(40,2),(40,3),(41,1),(41,2),(41,3),(42,1),(42,2);

--
-- Table structure for table `bap_language`
--

CREATE TABLE `bap_language` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `language_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bap_language`
--

INSERT INTO `bap_language` VALUES (1,'English','en',1,'2018-09-24 01:46:14','2018-09-24 01:46:14',NULL),(2,'Portugues','pt',1,'2018-09-24 01:51:03','2018-09-24 01:51:03',NULL);

--
-- Table structure for table `bap_date_format`
--

CREATE TABLE `bap_date_format` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `js_details` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Javascript Date Format',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bap_date_format`
--

INSERT INTO `bap_date_format` VALUES (1,'YYYY-MM-DD','Y-m-d','2018-09-24 01:46:12',NULL,NULL,'YYYY-MM-DD'),(2,'YY-MM-DD','y-m-d','2018-09-24 01:46:12',NULL,NULL,'YY-MM-DD'),(3,'MM/DD/YYYY','m/d/Y','2018-09-24 01:46:12',NULL,NULL,'MM/DD/YYYY'),(4,'MM/DD/YY','m/d/y','2018-09-24 01:46:13',NULL,NULL,'MM/DD/YY'),(5,'DD/MM/YYYY','d/m/Y','2018-09-30 18:57:11','2018-09-30 18:57:11',NULL,'DD/MM/YYYY');

--
-- Table structure for table `status`
--

CREATE TABLE `status` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status`
--

INSERT INTO `status` VALUES (1,'Ativo','patrimônio ativo','2018-10-09 15:41:45','2018-10-09 15:41:45',NULL),(2,'Em manutenção','patrimônio em manutenção','2018-10-09 15:42:16','2018-10-09 15:42:16',NULL),(3,'Desabilitado','patrimônio desabilitado','2018-10-09 15:42:45','2018-10-09 15:42:45',NULL), (4,'Baixado','Patrimônio já baixado','2018-10-09 15:42:45','2018-10-09 15:42:45',NULL);

--
-- Table structure for table `model_has_roles`
--

CREATE TABLE `model_has_roles` (
  `role_id` int(10) unsigned NOT NULL,
  `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint(20) unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_type_model_id_index` (`model_type`,`model_id`),
  CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `model_has_roles`
--

INSERT INTO `model_has_roles` VALUES (1,'Modules\\Platform\\User\\Entities\\User',1),(2,'Modules\\Platform\\User\\Entities\\User',12),(2,'Modules\\Platform\\User\\Entities\\User',16),(3,'Modules\\Platform\\User\\Entities\\User',13),(3,'Modules\\Platform\\User\\Entities\\User',14),(3,'Modules\\Platform\\User\\Entities\\User',15),(3,'Modules\\Platform\\User\\Entities\\User',17);


