# ************************************************************
# Sequel Ace SQL dump
# Version 20039
#
# https://sequel-ace.com/
# https://github.com/Sequel-Ace/Sequel-Ace
#
# Host: 127.0.0.1 (MySQL 8.0.27)
# Database: schoolinn_db
# Generation Time: 2022-10-24 10:36:02 +0000
# ************************************************************




# Dump of table failed_jobs
# ------------------------------------------------------------


CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table migrations
# ------------------------------------------------------------


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


INSERT INTO `migrations` (`id`, `migration`, `batch`)
VALUES
	(11,'2014_10_12_000000_create_users_table',1),
	(12,'2014_10_12_100000_create_password_resets_table',1),
	(13,'2016_06_01_000001_create_oauth_auth_codes_table',1),
	(14,'2016_06_01_000002_create_oauth_access_tokens_table',1),
	(15,'2016_06_01_000003_create_oauth_refresh_tokens_table',1),
	(16,'2016_06_01_000004_create_oauth_clients_table',1),
	(17,'2016_06_01_000005_create_oauth_personal_access_clients_table',1),
	(18,'2019_08_19_000000_create_failed_jobs_table',1),
	(19,'2019_12_14_000001_create_personal_access_tokens_table',1),
	(20,'2022_10_21_183915_create_permission_tables',1);



# Dump of table model_has_permissions
# ------------------------------------------------------------


CREATE TABLE `model_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
  KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`),
  CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table model_has_roles
# ------------------------------------------------------------


CREATE TABLE `model_has_roles` (
  `role_id` bigint unsigned NOT NULL,
  `model_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_id` bigint unsigned NOT NULL,
  PRIMARY KEY (`role_id`,`model_id`,`model_type`),
  KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`),
  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;



# Dump of table oauth_access_tokens
# ------------------------------------------------------------


CREATE TABLE `oauth_access_tokens` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `client_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scopes` text COLLATE utf8mb4_unicode_ci,
  `revoked` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `oauth_access_tokens_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `oauth_access_tokens` (`id`, `user_id`, `client_id`, `name`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`)
VALUES
	('3cfd8868c48ba98257c01a109997010298557958c242c621a22152fa8178a38cdd60ec6c96a6cba2',1,'978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'[]',0,'2022-10-24 08:03:54','2022-10-24 08:03:54','2022-10-24 08:18:54'),
	('508380562839f032a4a1a0d5a323f060fc319f4f1a420e7f873e2a85311ef6371f5b278ae7d3c9c9',1,'978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'[]',1,'2022-10-22 12:01:44','2022-10-22 12:01:44','2022-10-22 12:16:44'),
	('8a7815ed83b2eb11b834ad11649ce9fadac990367aabf2d371091c7bb01832469de03ce5aee7af6c',1,'978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'[]',1,'2022-10-22 16:03:22','2022-10-22 16:03:22','2022-10-22 16:18:22'),
	('9096ab99d12f61c833c2b618335fb793e549402ff02fa0cc3b7794c5a241fafae7c9e3b7379417fb',1,'978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'[]',1,'2022-10-23 10:52:55','2022-10-23 10:52:55','2022-10-23 11:07:55'),
	('eb070ee7f1ddfae4455834cd1aaec0b90c820f9c73e028a50646f6d2bc8ff216965b22e111b27910',1,'978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'[]',0,'2022-10-24 09:51:37','2022-10-24 09:51:37','2022-10-24 10:06:37');



# Dump of table oauth_auth_codes
# ------------------------------------------------------------


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



# Dump of table oauth_clients
# ------------------------------------------------------------


CREATE TABLE `oauth_clients` (
  `id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `secret` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provider` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `personal_access_client` tinyint(1) NOT NULL,
  `password_client` tinyint(1) NOT NULL,
  `revoked` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `oauth_clients_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `provider`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`)
VALUES
	('978e60e0-8078-4bb1-b1f1-558c625a4acd',NULL,'SchoolInn Personal Access Client','PLiXQnyYgaHYWpfSWcntiQV2WZMoU50FfMfyt6iB',NULL,'http://localhost',1,0,0,'2022-10-21 18:41:04','2022-10-21 18:41:04'),
	('978e60e0-8231-4d99-8519-df4207f7ff15',NULL,'SchoolInn Password Grant Client','NvTtB2PvkL2r0N9yr3zHC7BAQBPgAhaD29ZjYFRI','users','http://localhost',0,1,0,'2022-10-21 18:41:04','2022-10-21 18:41:04');



# Dump of table oauth_personal_access_clients
# ------------------------------------------------------------


CREATE TABLE `oauth_personal_access_clients` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `client_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`)
VALUES
	(1,'978e60e0-8078-4bb1-b1f1-558c625a4acd','2022-10-21 18:41:04','2022-10-21 18:41:04');



# Dump of table oauth_refresh_tokens
# ------------------------------------------------------------


CREATE TABLE `oauth_refresh_tokens` (
  `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `revoked` tinyint(1) NOT NULL,
  `expires_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `oauth_refresh_tokens` (`id`, `access_token_id`, `revoked`, `expires_at`)
VALUES
	('44c156f6716e051aa8383b33be33d0d8686293175f0301569936954575df85b11a420e15674e413a','8a7815ed83b2eb11b834ad11649ce9fadac990367aabf2d371091c7bb01832469de03ce5aee7af6c',1,'2022-11-21 16:03:23'),
	('50411cbe213957c2080c8a2727149998ade134323805818dfc8a5c9d427a1a8d5471163cbfbab6f3','9096ab99d12f61c833c2b618335fb793e549402ff02fa0cc3b7794c5a241fafae7c9e3b7379417fb',1,'2022-11-22 10:52:55'),
	('a8ff6a48a5b375dfb0d0877aa500e48088d671213d11bee0519048f4f29aa330b3baa141e20ed1f4','508380562839f032a4a1a0d5a323f060fc319f4f1a420e7f873e2a85311ef6371f5b278ae7d3c9c9',1,'2022-11-21 12:01:44'),
	('b386258515dd82a7df4ee156d9ad08ed9b4c26846fd616e1e2d474ddb85b47473c9d0fd494eefce7','3cfd8868c48ba98257c01a109997010298557958c242c621a22152fa8178a38cdd60ec6c96a6cba2',0,'2022-11-23 08:03:54'),
	('b74db689ef2537211ffa8d2f120a74b7340f08dbd2f4ca7f028ec0249506bf40e98d7abd9e765414','eb070ee7f1ddfae4455834cd1aaec0b90c820f9c73e028a50646f6d2bc8ff216965b22e111b27910',0,'2022-11-23 09:51:37');



# Dump of table password_resets
# ------------------------------------------------------------


CREATE TABLE `password_resets` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table permissions
# ------------------------------------------------------------


CREATE TABLE `permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `permissions_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table personal_access_tokens
# ------------------------------------------------------------


CREATE TABLE `personal_access_tokens` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokenable_id` bigint unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `abilities` text COLLATE utf8mb4_unicode_ci,
  `last_used_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
  KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table role_has_permissions
# ------------------------------------------------------------


CREATE TABLE `role_has_permissions` (
  `permission_id` bigint unsigned NOT NULL,
  `role_id` bigint 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;



# Dump of table roles
# ------------------------------------------------------------


CREATE TABLE `roles` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `guard_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `roles_name_guard_name_unique` (`name`,`guard_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table users
# ------------------------------------------------------------


CREATE TABLE `users` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `first_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email_verified_at` timestamp NULL DEFAULT NULL,
  `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('ACTIVE','INACTIVE','BLOCKED','SUSPENDED') COLLATE utf8mb4_unicode_ci DEFAULT 'ACTIVE',
  `group` enum('PARENT','TEACHER','STUDENT','ADMIN') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT 'ADMIN',
  `super_admin` tinyint(1) DEFAULT '0',
  `hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `users` (`id`, `first_name`, `last_name`, `code`, `title`, `email`, `email_verified_at`, `password`, `remember_token`, `avatar`, `phone`, `status`, `group`, `super_admin`, `hash`, `created_at`, `updated_at`, `deleted_at`)
VALUES
	(1,'Admin','SP',NULL,NULL,'super.admin@axiom.pk','2022-06-14 20:47:13','$2y$10$lBk.sSphlIZfP970oDdVCelYo2o7M1Eem1Je8ghhq33MYkSi.Ao5a','asdf334af',NULL,NULL,'ACTIVE','ADMIN',1,NULL,'2022-06-14 20:47:13','2022-06-14 20:47:13',NULL);




