--
-- Host: localhost    Database: gcl_auth
-- ------------------------------------------------------


--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2016_06_01_000001_create_oauth_auth_codes_table',1),(4,'2016_06_01_000002_create_oauth_access_tokens_table',1),(5,'2016_06_01_000003_create_oauth_refresh_tokens_table',1),(6,'2016_06_01_000004_create_oauth_clients_table',1),(7,'2016_06_01_000005_create_oauth_personal_access_clients_table',1),(8,'2017_03_09_133204_entrust_setup_tables',1),(9,'2017_07_07_133859_create_user_details_table',1),(10,'2017_08_22_155615_add_users_image_field',2);

--
-- Table structure for table `oauth_auth_codes`
--

CREATE TABLE `oauth_auth_codes` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int(11) NOT NULL,
  `client_id` int(11) NOT NULL,
  `scopes` text COLLATE utf8mb4_unicode_ci,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `oauth_auth_codes`
--


--
-- Table structure for table `oauth_personal_access_clients`
--

CREATE TABLE `oauth_personal_access_clients` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `client_id` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `oauth_personal_access_clients_client_id_index` (`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `oauth_personal_access_clients`
--


--
-- Table structure for table `permission_role`
--

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

--
-- Dumping data for table `permission_role`
--


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

CREATE TABLE `permissions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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


--
-- Table structure for table `role_user`
--

CREATE TABLE `role_user` (
  `user_id` int(10) unsigned NOT NULL,
  `role_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`user_id`,`role_id`),
  KEY `role_user_role_id_foreign` (`role_id`),
  CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_user`
--

INSERT INTO `role_user` VALUES (1,5),(59,5),(73,5),(74,5),(75,5),(79,5),(82,5),(85,5),(86,5),(87,5),(91,5),(95,5),(97,5),(109,5),(123,5),(132,5),(133,5),(135,5),(136,5),(139,5),(143,5),(154,5),(158,5),(161,5),(162,5),(169,5),(197,5),(217,5),(220,5),(232,5),(246,5),(248,5),(261,5),(269,5),(270,5),(271,5),(272,5),(76,6),(80,6),(84,6),(92,6),(93,6),(96,6),(107,6),(108,6),(115,6),(118,6),(120,6),(124,6),(127,6),(129,6),(131,6),(134,6),(141,6),(142,6),(145,6),(155,6),(157,6),(159,6),(175,6),(191,6),(204,6),(205,6),(216,6),(221,6),(223,6),(226,6),(227,6),(245,6),(247,6),(249,6),(250,6),(263,6),(268,6),(78,7),(83,7),(88,7),(89,7),(90,7),(94,7),(98,7),(99,7),(100,7),(101,7),(103,7),(104,7),(106,7),(112,7),(113,7),(116,7),(117,7),(119,7),(121,7),(122,7),(125,7),(126,7),(128,7),(130,7),(138,7),(140,7),(144,7),(146,7),(152,7),(153,7),(156,7),(160,7),(166,7),(168,7),(170,7),(171,7),(172,7),(173,7),(174,7),(176,7),(177,7),(179,7),(180,7),(181,7),(182,7),(183,7),(184,7),(185,7),(186,7),(187,7),(188,7),(189,7),(190,7),(192,7),(193,7),(194,7),(195,7),(196,7),(199,7),(200,7),(203,7),(206,7),(208,7),(209,7),(210,7),(211,7),(212,7),(214,7),(219,7),(222,7),(228,7),(229,7),(230,7),(231,7),(237,7),(238,7),(242,7),(243,7),(251,7),(252,7),(253,7),(254,7),(255,7),(256,7),(257,7),(258,7),(259,7),(260,7),(262,7),(264,7),(265,7),(266,7),(77,8),(81,8),(105,8),(114,8),(137,8),(178,8),(202,8),(207,8),(213,8),(215,8),(218,8),(224,8),(225,8),(233,8),(234,8),(235,8),(236,8),(239,8),(240,8),(241,8),(244,8),(267,8);

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

CREATE TABLE `roles` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` VALUES (5,'Waste Administrator','Administrator','The main administrator.','2017-08-10 13:08:23','2017-08-10 13:08:23'),(6,'Waste Office Administrator','Office Admin','The office administrator.','2017-08-10 13:08:23','2017-08-10 13:08:23'),(7,'Waste Site Administrator','Site Admin','The site administrator.','2017-08-10 13:08:23','2017-08-10 13:08:23'),(8,'Waste Site Operative','Site Operative','The site operative.','2017-08-10 13:08:23','2017-08-10 13:08:23');


