--
-- Host: localhost    Database: asiatradegate_bookstack
-- ------------------------------------------------------


--
-- Table structure for table `activities`
--

CREATE TABLE `activities` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `detail` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `ip` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
  `loggable_id` int DEFAULT NULL,
  `loggable_type` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `activities_user_id_index` (`user_id`),
  KEY `activities_entity_id_index` (`loggable_id`),
  KEY `activities_key_index` (`type`),
  KEY `activities_created_at_index` (`created_at`),
  KEY `activities_ip_index` (`ip`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activities`
--

INSERT INTO `activities` VALUES (1,'auth_login','standard; (1) Admin',1,'127.0.0.1',NULL,NULL,'2024-11-30 21:32:43','2024-11-30 21:32:43'),(2,'auth_login','standard; (1) Admin',1,'171.236.69.201',NULL,NULL,'2024-12-01 04:51:44','2024-12-01 04:51:44'),(3,'auth_login','standard; (1) Admin',1,'171.236.69.201',NULL,NULL,'2024-12-05 04:00:25','2024-12-05 04:00:25'),(4,'auth_login','standard; (1) Admin',1,'196.158.158.37',NULL,NULL,'2024-12-09 05:02:00','2024-12-09 05:02:00'),(5,'book_create','(1) New test book',1,'196.158.158.37',1,'book','2024-12-09 05:04:51','2024-12-09 05:04:51'),(6,'chapter_create','(1) Chapter1',1,'196.158.158.37',1,'chapter','2024-12-09 05:06:01','2024-12-09 05:06:01'),(7,'page_create','(1) Page 1 test',1,'196.158.158.37',1,'page','2024-12-09 05:06:39','2024-12-09 05:06:39'),(8,'page_update','(1) Page 1 test',1,'196.158.158.37',1,'page','2024-12-09 05:15:36','2024-12-09 05:15:36'),(9,'page_update','(1) Page 1 test',1,'196.158.158.37',1,'page','2024-12-09 05:17:16','2024-12-09 05:17:16'),(10,'auth_login','standard; (1) Admin',1,'156.195.16.195',NULL,NULL,'2024-12-09 07:22:20','2024-12-09 07:22:20'),(11,'settings_update','customization',1,'156.195.16.195',NULL,NULL,'2024-12-10 10:54:46','2024-12-10 10:54:46'),(12,'auth_login','standard; (1) Admin',1,'171.236.69.183',NULL,NULL,'2024-12-21 04:00:04','2024-12-21 04:00:04'),(13,'auth_login','standard; (1) Admin',1,'103.112.54.243',NULL,NULL,'2024-12-22 14:44:57','2024-12-22 14:44:57'),(14,'auth_login','standard; (1) Admin',1,'139.162.141.160',NULL,NULL,'2025-01-07 16:28:28','2025-01-07 16:28:28'),(15,'role_update','(1) Admin',1,'139.162.141.160',NULL,NULL,'2025-01-07 16:50:02','2025-01-07 16:50:02'),(16,'auth_login','standard; (1) Admin',1,'103.137.72.29',NULL,NULL,'2025-01-11 11:13:22','2025-01-11 11:13:22'),(17,'auth_login','standard; (1) Admin',1,'103.137.72.29',NULL,NULL,'2025-01-11 13:32:13','2025-01-11 13:32:13'),(18,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-11 13:47:14','2025-01-11 13:47:14'),(19,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:16:53','2025-01-12 01:16:53'),(20,'bookshelf_create','(1) كتب دينية',1,'156.195.60.198',1,'bookshelf','2025-01-12 01:18:00','2025-01-12 01:18:00'),(21,'bookshelf_create','(2) كتب أدبية وروايات',1,'156.195.60.198',2,'bookshelf','2025-01-12 01:20:32','2025-01-12 01:20:32'),(22,'book_create','(2) رواية جديدة',1,'156.195.60.198',2,'book','2025-01-12 01:23:43','2025-01-12 01:23:43'),(23,'chapter_create','(2) الفصل الاول',1,'156.195.60.198',2,'chapter','2025-01-12 01:25:54','2025-01-12 01:25:54'),(24,'chapter_create','(3) الفصل الثاني',1,'156.195.60.198',3,'chapter','2025-01-12 01:28:20','2025-01-12 01:28:20'),(25,'page_create','(2) موقف في الصين',1,'156.195.60.198',2,'page','2025-01-12 01:29:29','2025-01-12 01:29:29'),(26,'page_create','(3) موقف في البرازيل',1,'156.195.60.198',3,'page','2025-01-12 01:30:31','2025-01-12 01:30:31'),(27,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:34:31','2025-01-12 01:34:31'),(28,'user_create','(3) محمد الهامي',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:41:34','2025-01-12 01:41:34'),(29,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:45:06','2025-01-12 01:45:06'),(30,'auth_login','standard; (3) محمد الهامي',3,'156.195.60.198',NULL,NULL,'2025-01-12 01:46:02','2025-01-12 01:46:02'),(31,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:47:29','2025-01-12 01:47:29'),(32,'user_update','(3) محمد الهامي',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:48:32','2025-01-12 01:48:32'),(33,'auth_login','standard; (3) محمد الهامي',3,'156.195.60.198',NULL,NULL,'2025-01-12 01:49:01','2025-01-12 01:49:01'),(34,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:50:42','2025-01-12 01:50:42'),(35,'user_update','(3) محمد الهامي',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:52:21','2025-01-12 01:52:21'),(36,'user_create','(4) Public user',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:53:45','2025-01-12 01:53:45'),(37,'user_create','(5) Viewer user',1,'156.195.60.198',NULL,NULL,'2025-01-12 01:55:32','2025-01-12 01:55:32'),(38,'role_update','(2) Editor',1,'156.195.60.198',NULL,NULL,'2025-01-12 02:01:55','2025-01-12 02:01:55'),(39,'auth_login','standard; (3) محمد الهامي',3,'156.195.60.198',NULL,NULL,'2025-01-12 02:06:25','2025-01-12 02:06:25'),(40,'page_update','(2) موقف في الصين',3,'156.195.60.198',2,'page','2025-01-12 02:07:14','2025-01-12 02:07:14'),(41,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 02:08:58','2025-01-12 02:08:58'),(42,'comment_create','Comment #1 (ID: 1) for page (ID: 2)',1,'156.195.60.198',NULL,NULL,'2025-01-12 02:11:40','2025-01-12 02:11:40'),(43,'commented_on','(2) موقف في الصين',1,'156.195.60.198',2,'page','2025-01-12 02:11:40','2025-01-12 02:11:40'),(44,'role_update','(2) Editor',1,'156.195.60.198',NULL,NULL,'2025-01-12 02:15:16','2025-01-12 02:15:16'),(45,'auth_login','standard; (3) محمد الهامي',3,'156.195.60.198',NULL,NULL,'2025-01-12 02:15:26','2025-01-12 02:15:26'),(46,'comment_create','Comment #2 (ID: 2) for page (ID: 2)',3,'156.195.60.198',NULL,NULL,'2025-01-12 02:17:15','2025-01-12 02:17:15'),(47,'commented_on','(2) موقف في الصين',3,'156.195.60.198',2,'page','2025-01-12 02:17:15','2025-01-12 02:17:15'),(48,'auth_login','standard; (1) Admin',1,'156.195.60.198',NULL,NULL,'2025-01-12 02:29:31','2025-01-12 02:29:31'),(49,'page_create','(4) اقتراحاتك هنا',1,'156.195.60.198',4,'page','2025-01-12 02:31:29','2025-01-12 02:31:29'),(50,'page_create','(6) New page 2',1,'156.195.60.198',6,'page','2025-01-12 02:34:34','2025-01-12 02:34:34'),(51,'chapter_create','(4) Chapter 2',1,'156.195.60.198',4,'chapter','2025-01-12 02:35:13','2025-01-12 02:35:13'),(52,'page_create','(7) Page1 chapter 2',1,'156.195.60.198',7,'page','2025-01-12 02:35:43','2025-01-12 02:35:43'),(53,'permissions_update','(4) اقتراحاتك هنا',1,'156.195.60.198',4,'page','2025-01-12 02:46:32','2025-01-12 02:46:32'),(54,'auth_login','standard; (3) محمد الهامي',3,'156.195.60.198',NULL,NULL,'2025-01-12 02:46:45','2025-01-12 02:46:45'),(55,'page_update','(4) اقتراحاتك هنا',3,'156.195.60.198',4,'page','2025-01-12 02:47:06','2025-01-12 02:47:06'),(56,'page_update','(4) اقتراحاتك هنا',3,'156.195.60.198',4,'page','2025-01-12 02:47:18','2025-01-12 02:47:18'),(57,'auth_login','standard; (1) Admin',1,'171.236.69.214',NULL,NULL,'2025-01-12 03:33:01','2025-01-12 03:33:01'),(58,'auth_login','standard; (1) Admin',1,'171.236.69.214',NULL,NULL,'2025-01-12 03:36:52','2025-01-12 03:36:52'),(59,'auth_login','standard; (1) Admin',1,'171.236.69.214',NULL,NULL,'2025-01-12 03:38:11','2025-01-12 03:38:11'),(60,'auth_login','standard; (1) Admin',1,'156.195.81.219',NULL,NULL,'2025-01-14 07:32:16','2025-01-14 07:32:16'),(61,'auth_login','standard; (1) Admin',1,'196.153.174.126',NULL,NULL,'2025-01-17 14:41:18','2025-01-17 14:41:18'),(62,'auth_login','standard; (1) Admin',1,'41.42.221.249',NULL,NULL,'2025-01-21 01:19:56','2025-01-21 01:19:56'),(63,'auth_login','standard; (1) Admin',1,'156.195.66.122',NULL,NULL,'2025-01-22 11:20:11','2025-01-22 11:20:11'),(64,'auth_login','standard; (1) Admin',1,'103.112.54.243',NULL,NULL,'2025-01-22 15:10:52','2025-01-22 15:10:52'),(65,'auth_login','standard; (1) Admin',1,'156.195.66.122',NULL,NULL,'2025-01-22 17:56:50','2025-01-22 17:56:50');

--
-- Table structure for table `attachments`
--

CREATE TABLE `attachments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `extension` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uploaded_to` int NOT NULL,
  `external` tinyint(1) NOT NULL,
  `order` int NOT NULL,
  `created_by` int NOT NULL,
  `updated_by` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `attachments_uploaded_to_index` (`uploaded_to`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `attachments`
--


--
-- Table structure for table `books`
--

CREATE TABLE `books` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL,
  `updated_by` int NOT NULL,
  `image_id` int DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `owned_by` int unsigned NOT NULL,
  `default_template_id` int DEFAULT NULL,
  `description_html` text COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `books_slug_index` (`slug`),
  KEY `books_created_by_index` (`created_by`),
  KEY `books_updated_by_index` (`updated_by`),
  KEY `books_owned_by_index` (`owned_by`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `books`
--

INSERT INTO `books` VALUES (1,'New test book','new-test-book','New test book','2024-12-09 05:04:51','2024-12-09 05:04:51',1,1,NULL,NULL,1,NULL,'<p>New test book</p>'),(2,'رواية جديدة','roay-gdyd','هنا رواية جديدة','2025-01-12 01:23:43','2025-01-12 01:23:43',1,1,2,NULL,1,NULL,'<p>هنا رواية جديدة</p>');

--
-- Table structure for table `bookshelves`
--

CREATE TABLE `bookshelves` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` int DEFAULT NULL,
  `updated_by` int DEFAULT NULL,
  `image_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `owned_by` int unsigned NOT NULL,
  `description_html` text COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `bookshelves_slug_index` (`slug`),
  KEY `bookshelves_created_by_index` (`created_by`),
  KEY `bookshelves_updated_by_index` (`updated_by`),
  KEY `bookshelves_owned_by_index` (`owned_by`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bookshelves`
--

INSERT INTO `bookshelves` VALUES (1,'كتب دينية','ktb-dyny','رف الكتب الدينية',1,1,NULL,'2025-01-12 01:18:00','2025-01-12 01:18:00',NULL,1,'<p>رف الكتب الدينية</p>'),(2,'كتب أدبية وروايات','ktb-adby-oroayat','هنا كتب أدبية وروايات',1,1,1,'2025-01-12 01:20:32','2025-01-12 01:20:32',NULL,1,'<p>هنا كتب أدبية وروايات</p>');

--
-- Table structure for table `bookshelves_books`
--

CREATE TABLE `bookshelves_books` (
  `bookshelf_id` int unsigned NOT NULL,
  `book_id` int unsigned NOT NULL,
  `order` int unsigned NOT NULL,
  PRIMARY KEY (`bookshelf_id`,`book_id`),
  KEY `bookshelves_books_book_id_foreign` (`book_id`),
  CONSTRAINT `bookshelves_books_book_id_foreign` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `bookshelves_books_bookshelf_id_foreign` FOREIGN KEY (`bookshelf_id`) REFERENCES `bookshelves` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bookshelves_books`
--

INSERT INTO `bookshelves_books` VALUES (2,1,0);

--
-- Table structure for table `chapters`
--

CREATE TABLE `chapters` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `book_id` int NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL,
  `updated_by` int NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `owned_by` int unsigned NOT NULL,
  `description_html` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `default_template_id` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `chapters_slug_index` (`slug`),
  KEY `chapters_book_id_index` (`book_id`),
  KEY `chapters_priority_index` (`priority`),
  KEY `chapters_created_by_index` (`created_by`),
  KEY `chapters_updated_by_index` (`updated_by`),
  KEY `chapters_owned_by_index` (`owned_by`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `chapters`
--

INSERT INTO `chapters` VALUES (1,1,'chapter1','Chapter1','Chapter1',2,'2024-12-09 05:06:00','2024-12-09 05:06:00',1,1,NULL,1,'<p>Chapter1</p>',NULL),(2,2,'alfsl-alaol','الفصل الاول','وصف الوصف الاول',2,'2025-01-12 01:25:54','2025-01-12 01:25:54',1,1,NULL,1,'<p>وصف الوصف الاول</p>',NULL),(3,2,'alfsl-althany','الفصل الثاني','وصف الفصل الثاني',3,'2025-01-12 01:28:20','2025-01-12 01:28:20',1,1,NULL,1,'<p>وصف الفصل الثاني</p>',NULL),(4,1,'chapter-2','Chapter 2','',3,'2025-01-12 02:35:13','2025-01-12 02:35:13',1,1,NULL,1,'',NULL);

--
-- Table structure for table `comments`
--

CREATE TABLE `comments` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `entity_id` int unsigned NOT NULL,
  `entity_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `text` longtext COLLATE utf8mb4_unicode_ci,
  `html` longtext COLLATE utf8mb4_unicode_ci,
  `parent_id` int unsigned DEFAULT NULL,
  `local_id` int unsigned DEFAULT NULL,
  `created_by` int unsigned NOT NULL,
  `updated_by` int unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `comments_entity_id_entity_type_index` (`entity_id`,`entity_type`),
  KEY `comments_local_id_index` (`local_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `comments`
--

INSERT INTO `comments` VALUES (1,2,'page',NULL,'<p>تعليق جديد</p>',NULL,1,1,1,'2025-01-12 02:11:40','2025-01-12 02:11:40'),(2,2,'page',NULL,'<p>اهلا وسهلا اقترح أن يضاف هذا لهذه الجزئية</p><p></p>',NULL,2,3,3,'2025-01-12 02:17:15','2025-01-12 02:17:15');

--
-- Table structure for table `deletions`
--

CREATE TABLE `deletions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `deleted_by` int NOT NULL,
  `deletable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deletable_id` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `deletions_deleted_by_index` (`deleted_by`),
  KEY `deletions_deletable_type_index` (`deletable_type`),
  KEY `deletions_deletable_id_index` (`deletable_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `deletions`
--


--
-- Table structure for table `entity_permissions`
--

CREATE TABLE `entity_permissions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `entity_id` int unsigned NOT NULL,
  `entity_type` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  `role_id` int unsigned NOT NULL,
  `view` tinyint(1) NOT NULL DEFAULT '0',
  `create` tinyint(1) NOT NULL DEFAULT '0',
  `update` tinyint(1) NOT NULL DEFAULT '0',
  `delete` tinyint(1) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `new_entity_permissions_entity_id_entity_type_index` (`entity_id`,`entity_type`),
  KEY `new_entity_permissions_role_id_index` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `entity_permissions`
--

INSERT INTO `entity_permissions` VALUES (1,4,'page',2,1,0,1,0);

--
-- Table structure for table `failed_jobs`
--

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(191) 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;

--
-- Dumping data for table `failed_jobs`
--


--
-- Table structure for table `favourites`
--

CREATE TABLE `favourites` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `favouritable_id` int NOT NULL,
  `favouritable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `favouritable_index` (`favouritable_id`,`favouritable_type`),
  KEY `favourites_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `favourites`
--


--
-- Table structure for table `images`
--

CREATE TABLE `images` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `url` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL,
  `updated_by` int NOT NULL,
  `path` varchar(400) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `uploaded_to` int NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `images_type_index` (`type`),
  KEY `images_uploaded_to_index` (`uploaded_to`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `images`
--

INSERT INTO `images` VALUES (1,'1000108510.jpg','https://ik.asiatradegate.com/uploads/images/cover_bookshelf/2025-01/1000108510.jpg','2025-01-12 01:20:32','2025-01-12 01:20:32',1,1,'/uploads/images/cover_bookshelf/2025-01/1000108510.jpg','cover_bookshelf',2),(2,'1000108314.jpg','https://ik.asiatradegate.com/uploads/images/cover_book/2025-01/1000108314.jpg','2025-01-12 01:23:43','2025-01-12 01:23:43',1,1,'/uploads/images/cover_book/2025-01/1000108314.jpg','cover_book',2),(3,'Hxxx4tkMKl-avatar.png','https://ik.asiatradegate.com/uploads/images/user/2025-01/hxxx4tkmkl-avatar.png','2025-01-12 01:41:34','2025-01-12 01:41:34',3,3,'/uploads/images/user/2025-01/hxxx4tkmkl-avatar.png','user',3),(4,'eAEOlWuehq-avatar.png','https://ik.asiatradegate.com/uploads/images/user/2025-01/eaeolwuehq-avatar.png','2025-01-12 01:53:45','2025-01-12 01:53:45',4,4,'/uploads/images/user/2025-01/eaeolwuehq-avatar.png','user',4),(5,'9XnB92nIHk-avatar.png','https://ik.asiatradegate.com/uploads/images/user/2025-01/9xnb92nihk-avatar.png','2025-01-12 01:55:32','2025-01-12 01:55:32',5,5,'/uploads/images/user/2025-01/9xnb92nihk-avatar.png','user',5);

--
-- Table structure for table `jobs`
--

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `jobs`
--


--
-- Table structure for table `joint_permissions`
--

CREATE TABLE `joint_permissions` (
  `role_id` int NOT NULL,
  `entity_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` int NOT NULL,
  `status` tinyint unsigned NOT NULL,
  `owner_id` int unsigned DEFAULT NULL,
  PRIMARY KEY (`role_id`,`entity_type`,`entity_id`),
  KEY `joint_permissions_entity_id_entity_type_index` (`entity_id`,`entity_type`),
  KEY `joint_permissions_role_id_index` (`role_id`),
  KEY `joint_permissions_status_index` (`status`),
  KEY `joint_permissions_owner_id_index` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `joint_permissions`
--

INSERT INTO `joint_permissions` VALUES (1,'book',1,3,1),(1,'book',2,3,1),(1,'bookshelf',1,3,1),(1,'bookshelf',2,3,1),(1,'chapter',1,3,1),(1,'chapter',2,3,1),(1,'chapter',3,3,1),(1,'chapter',4,3,1),(1,'page',1,3,1),(1,'page',2,3,1),(1,'page',3,3,1),(1,'page',4,3,1),(1,'page',5,3,1),(1,'page',6,3,1),(1,'page',7,3,1),(2,'book',1,1,1),(2,'book',2,1,1),(2,'bookshelf',1,1,1),(2,'bookshelf',2,1,1),(2,'chapter',1,1,1),(2,'chapter',2,1,1),(2,'chapter',3,1,1),(2,'chapter',4,1,1),(2,'page',1,1,1),(2,'page',2,1,1),(2,'page',3,1,1),(2,'page',4,3,NULL),(2,'page',5,1,1),(2,'page',6,1,1),(2,'page',7,1,1),(3,'book',1,1,1),(3,'book',2,1,1),(3,'bookshelf',1,1,1),(3,'bookshelf',2,1,1),(3,'chapter',1,1,1),(3,'chapter',2,1,1),(3,'chapter',3,1,1),(3,'chapter',4,1,1),(3,'page',1,1,1),(3,'page',2,1,1),(3,'page',3,1,1),(3,'page',4,1,1),(3,'page',5,1,1),(3,'page',6,1,1),(3,'page',7,1,1),(4,'book',1,1,1),(4,'book',2,1,1),(4,'bookshelf',1,1,1),(4,'bookshelf',2,1,1),(4,'chapter',1,1,1),(4,'chapter',2,1,1),(4,'chapter',3,1,1),(4,'chapter',4,1,1),(4,'page',1,1,1),(4,'page',2,1,1),(4,'page',3,1,1),(4,'page',4,1,1),(4,'page',5,1,1),(4,'page',6,1,1),(4,'page',7,1,1);

--
-- Table structure for table `languages`
--

CREATE TABLE `languages` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `direction` 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=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `languages`
--

INSERT INTO `languages` VALUES (3,'English','en','ltr','2025-01-07 16:59:01','2025-01-07 16:59:01'),(4,'Arabic','ar','rtl','2025-01-11 13:41:27','2025-01-11 13:41:27');

--
-- Table structure for table `mfa_values`
--

CREATE TABLE `mfa_values` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `method` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mfa_values_user_id_index` (`user_id`),
  KEY `mfa_values_method_index` (`method`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mfa_values`
--


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

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=86 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,'2015_07_12_114933_create_books_table',1),(4,'2015_07_12_190027_create_pages_table',1),(5,'2015_07_13_172121_create_images_table',1),(6,'2015_07_27_172342_create_chapters_table',1),(7,'2015_08_08_200447_add_users_to_entities',1),(8,'2015_08_09_093534_create_page_revisions_table',1),(9,'2015_08_16_142133_create_activities_table',1),(10,'2015_08_29_105422_add_roles_and_permissions',1),(11,'2015_08_30_125859_create_settings_table',1),(12,'2015_08_31_175240_add_search_indexes',1),(13,'2015_09_04_165821_create_social_accounts_table',1),(14,'2015_09_05_164707_add_email_confirmation_table',1),(15,'2015_11_21_145609_create_views_table',1),(16,'2015_11_26_221857_add_entity_indexes',1),(17,'2015_12_05_145049_fulltext_weighting',1),(18,'2015_12_07_195238_add_image_upload_types',1),(19,'2015_12_09_195748_add_user_avatars',1),(20,'2016_01_11_210908_add_external_auth_to_users',1),(21,'2016_02_25_184030_add_slug_to_revisions',1),(22,'2016_02_27_120329_update_permissions_and_roles',1),(23,'2016_02_28_084200_add_entity_access_controls',1),(24,'2016_03_09_203143_add_page_revision_types',1),(25,'2016_03_13_082138_add_page_drafts',1),(26,'2016_03_25_123157_add_markdown_support',1),(27,'2016_04_09_100730_add_view_permissions_to_roles',1),(28,'2016_04_20_192649_create_joint_permissions_table',1),(29,'2016_05_06_185215_create_tags_table',1),(30,'2016_07_07_181521_add_summary_to_page_revisions',1),(31,'2016_09_29_101449_remove_hidden_roles',1),(32,'2016_10_09_142037_create_attachments_table',1),(33,'2017_01_21_163556_create_cache_table',1),(34,'2017_01_21_163602_create_sessions_table',1),(35,'2017_03_19_091553_create_search_index_table',1),(36,'2017_04_20_185112_add_revision_counts',1),(37,'2017_07_02_152834_update_db_encoding_to_ut8mb4',1),(38,'2017_08_01_130541_create_comments_table',1),(39,'2017_08_29_102650_add_cover_image_display',1),(40,'2018_07_15_173514_add_role_external_auth_id',1),(41,'2018_08_04_115700_create_bookshelves_table',1),(42,'2019_07_07_112515_add_template_support',1),(43,'2019_08_17_140214_add_user_invites_table',1),(44,'2019_12_29_120917_add_api_auth',1),(45,'2020_08_04_111754_drop_joint_permissions_id',1),(46,'2020_08_04_131052_remove_role_name_field',1),(47,'2020_09_19_094251_add_activity_indexes',1),(48,'2020_09_27_210059_add_entity_soft_deletes',1),(49,'2020_09_27_210528_create_deletions_table',1),(50,'2020_11_07_232321_simplify_activities_table',1),(51,'2020_12_30_173528_add_owned_by_field_to_entities',1),(52,'2021_01_30_225441_add_settings_type_column',1),(53,'2021_03_08_215138_add_user_slug',1),(54,'2021_05_15_173110_create_favourites_table',1),(55,'2021_06_30_173111_create_mfa_values_table',1),(56,'2021_07_03_085038_add_mfa_enforced_to_roles_table',1),(57,'2021_08_28_161743_add_export_role_permission',1),(58,'2021_09_26_044614_add_activities_ip_column',1),(59,'2021_11_26_070438_add_index_for_user_ip',1),(60,'2021_12_07_111343_create_webhooks_table',1),(61,'2021_12_13_152024_create_jobs_table',1),(62,'2021_12_13_152120_create_failed_jobs_table',1),(63,'2022_01_03_154041_add_webhooks_timeout_error_columns',1),(64,'2022_04_17_101741_add_editor_change_field_and_permission',1),(65,'2022_04_25_140741_update_polymorphic_types',1),(66,'2022_07_16_170051_drop_joint_permission_type',1),(67,'2022_08_17_092941_create_references_table',1),(68,'2022_09_02_082910_fix_shelf_cover_image_types',1),(69,'2022_10_07_091406_flatten_entity_permissions_table',1),(70,'2022_10_08_104202_drop_entity_restricted_field',1),(71,'2023_01_24_104625_refactor_joint_permissions_storage',1),(72,'2023_01_28_141230_copy_color_settings_for_dark_mode',1),(73,'2023_02_20_093655_increase_attachments_path_length',1),(74,'2023_02_23_200227_add_updated_at_index_to_pages',1),(75,'2023_06_10_071823_remove_guest_user_secondary_roles',1),(76,'2023_06_25_181952_remove_bookshelf_create_entity_permissions',1),(77,'2023_07_25_124945_add_receive_notifications_role_permissions',1),(78,'2023_07_31_104430_create_watches_table',1),(79,'2023_08_21_174248_increase_cache_size',1),(80,'2023_12_02_104541_add_default_template_to_books',1),(81,'2023_12_17_140913_add_description_html_to_entities',1),(82,'2024_01_01_104542_add_default_template_to_chapters',1),(83,'2024_02_04_141358_add_views_updated_index',1),(84,'2024_05_04_154409_rename_activity_relation_columns',1),(85,'2024_09_29_140340_ensure_editor_value_set',1);

--
-- Table structure for table `page_revisions`
--

CREATE TABLE `page_revisions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `page_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `html` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `text` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_by` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `book_slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'version',
  `markdown` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `summary` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `revision_number` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `page_revisions_page_id_index` (`page_id`),
  KEY `page_revisions_slug_index` (`slug`),
  KEY `page_revisions_book_slug_index` (`book_slug`),
  KEY `page_revisions_type_index` (`type`),
  KEY `page_revisions_revision_number_index` (`revision_number`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `page_revisions`
--

INSERT INTO `page_revisions` VALUES (1,1,'Page 1 test','<p id=\"bkmrk-page-1-test\">Page 1 test</p>','Page 1 test',1,'2024-12-09 05:06:39','2024-12-09 05:06:39','page-1-test','new-test-book','version','','Initial publish',1),(3,1,'Page 1 test','<p id=\"bkmrk-page-1-test\"><strong>Page 1 test test 2</strong></p>','Page 1 test test 2',1,'2024-12-09 05:15:36','2024-12-09 05:15:36','page-1-test','new-test-book','version','','',2),(5,1,'Page 1 test','<p id=\"bkmrk-page-1-test\"><strong>Page 1 test test 2</strong></p>\r\n<p id=\"bkmrk-%C2%A0\">&nbsp;</p>','Page 1 test test 2\r\n ',1,'2024-12-09 05:17:16','2024-12-09 05:17:16','page-1-test','new-test-book','version','','',3),(6,2,'موقف في الصين','<p id=\"bkmrk-%D9%83%D8%A7%D9%86-%D9%87%D8%B0%D8%A7-%D8%A7%D9%84%D9%85%D9%88%D9%82%D9%81-%D8%A3%D9%85%D8%B1-%D8%B9\">كان هذا الموقف أمر عظيم</p>','كان هذا الموقف أمر عظيم',1,'2025-01-12 01:29:29','2025-01-12 01:29:29','mokf-fy-alsyn','roay-gdyd','version','','نشر مبدئي',1),(7,3,'موقف في البرازيل','<p id=\"bkmrk-%D9%87%D9%84%D9%82-%D8%AA%D8%A9%D8%A8%D9%82%D9%86.-%D8%A7%D9%84%D9%84%D9%84%D9%84\">هلق تةبقن. الللل</p>','هلق تةبقن. الللل',1,'2025-01-12 01:30:31','2025-01-12 01:30:31','mokf-fy-albrazyl','roay-gdyd','version','','نشر مبدئي',1),(8,2,'موقف في الصين','<p id=\"bkmrk-%D9%83%D8%A7%D9%86-%D9%87%D8%B0%D8%A7-%D8%A7%D9%84%D9%85%D9%88%D9%82%D9%81-%D8%A3%D9%85%D8%B1-%D8%B9\">كان هذا الموقف أمر عظيم</p>\r\n<p id=\"bkmrk-%C2%A0\">&nbsp;</p>\r\n<p id=\"bkmrk-%D8%AA%D8%B9%D8%AF%D9%8A%D9%84-%D9%85%D9%86-%D8%A7%D9%84%D9%85%D8%AD%D8%B1%D8%B1\">تعديل من المحرر</p>','كان هذا الموقف أمر عظيم\r\n \r\nتعديل من المحرر',3,'2025-01-12 02:07:14','2025-01-12 02:07:14','mokf-fy-alsyn','roay-gdyd','version','','',2),(9,4,'اقتراحاتك هنا','<p id=\"bkmrk-%D8%A7%D8%B0%D8%A7-%D9%83%D9%86%D8%AA-%D8%AA%D8%B1%D9%8A%D8%AF-%D8%A7%D8%B6%D8%A7%D9%81%D8%A9%D9%81%D8%B5\">اذا كنت تريد اضافةفصل أو صفحة جديدا أو بابا جديدا رجاء الاقتراح هنا لكن تاكد من قراءتك الجيدة لجميع الفصول</p>','اذا كنت تريد اضافةفصل أو صفحة جديدا أو بابا جديدا رجاء الاقتراح هنا لكن تاكد من قراءتك الجيدة لجميع الفصول',1,'2025-01-12 02:31:29','2025-01-12 02:31:29','aktrahatk-hna','roay-gdyd','version','','نشر مبدئي',1),(10,6,'New page 2','','',1,'2025-01-12 02:34:34','2025-01-12 02:34:34','new-page-2','new-test-book','version','','نشر مبدئي',1),(11,7,'Page1 chapter 2','','',1,'2025-01-12 02:35:43','2025-01-12 02:35:43','page1-chapter-2','new-test-book','version','','نشر مبدئي',1);

--
-- Table structure for table `pages`
--

CREATE TABLE `pages` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `book_id` int NOT NULL,
  `chapter_id` int NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `slug` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `html` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `text` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_by` int NOT NULL,
  `updated_by` int NOT NULL,
  `draft` tinyint(1) NOT NULL DEFAULT '0',
  `markdown` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `revision_count` int NOT NULL,
  `template` tinyint(1) NOT NULL DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `owned_by` int unsigned NOT NULL,
  `editor` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `pages_slug_index` (`slug`),
  KEY `pages_book_id_index` (`book_id`),
  KEY `pages_chapter_id_index` (`chapter_id`),
  KEY `pages_priority_index` (`priority`),
  KEY `pages_created_by_index` (`created_by`),
  KEY `pages_updated_by_index` (`updated_by`),
  KEY `pages_draft_index` (`draft`),
  KEY `pages_template_index` (`template`),
  KEY `pages_owned_by_index` (`owned_by`),
  KEY `pages_updated_at_index` (`updated_at`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pages`
--

INSERT INTO `pages` VALUES (1,1,1,'Page 1 test','page-1-test','<p id=\"bkmrk-page-1-test\"><strong>Page 1 test test 2</strong></p>\r\n<p id=\"bkmrk-%C2%A0\">&nbsp;</p>','Page 1 test test 2\r\n ',1,'2024-12-09 05:06:10','2024-12-09 05:17:16',1,1,0,'',3,0,NULL,1,'wysiwyg'),(2,2,2,'موقف في الصين','mokf-fy-alsyn','<p id=\"bkmrk-%D9%83%D8%A7%D9%86-%D9%87%D8%B0%D8%A7-%D8%A7%D9%84%D9%85%D9%88%D9%82%D9%81-%D8%A3%D9%85%D8%B1-%D8%B9\">كان هذا الموقف أمر عظيم</p>\r\n<p id=\"bkmrk-%C2%A0\">&nbsp;</p>\r\n<p id=\"bkmrk-%D8%AA%D8%B9%D8%AF%D9%8A%D9%84-%D9%85%D9%86-%D8%A7%D9%84%D9%85%D8%AD%D8%B1%D8%B1\">تعديل من المحرر</p>','كان هذا الموقف أمر عظيم\r\n \r\nتعديل من المحرر',1,'2025-01-12 01:28:32','2025-01-12 02:07:14',1,3,0,'',2,0,NULL,1,'wysiwyg'),(3,2,2,'موقف في البرازيل','mokf-fy-albrazyl','<p id=\"bkmrk-%D9%87%D9%84%D9%82-%D8%AA%D8%A9%D8%A8%D9%82%D9%86.-%D8%A7%D9%84%D9%84%D9%84%D9%84\">هلق تةبقن. الللل</p>','هلق تةبقن. الللل',2,'2025-01-12 01:29:58','2025-01-12 01:30:31',1,1,0,'',1,0,NULL,1,'wysiwyg'),(4,2,2,'اقتراحاتك هنا','aktrahatk-hna','<p id=\"bkmrk-%D8%A7%D8%B0%D8%A7-%D9%83%D9%86%D8%AA-%D8%AA%D8%B1%D9%8A%D8%AF-%D8%A7%D8%B6%D8%A7%D9%81%D8%A9%D9%81%D8%B5\">اذا كنت تريد اضافةفصل أو صفحة جديدا أو بابا جديدا رجاء الاقتراح هنا لكن تاكد من قراءتك الجيدة لجميع الفصول</p>','اذا كنت تريد اضافةفصل أو صفحة جديدا أو بابا جديدا رجاء الاقتراح هنا لكن تاكد من قراءتك الجيدة لجميع الفصول',3,'2025-01-12 02:30:03','2025-01-12 02:47:18',1,3,0,'',3,0,NULL,1,'wysiwyg'),(5,2,0,'صفحة جديدة','','','',0,'2025-01-12 02:32:26','2025-01-12 02:32:26',1,1,1,'',0,0,NULL,1,'wysiwyg'),(6,1,1,'New page 2','new-page-2','','',2,'2025-01-12 02:34:18','2025-01-12 02:34:34',1,1,0,'',1,0,NULL,1,'wysiwyg'),(7,1,4,'Page1 chapter 2','page1-chapter-2','','',1,'2025-01-12 02:35:18','2025-01-12 02:35:43',1,1,0,'',1,0,NULL,1,'wysiwyg');

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

CREATE TABLE `permission_role` (
  `permission_id` int unsigned NOT NULL,
  `role_id` int 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 `role_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`
--

INSERT INTO `permission_role` VALUES (19,1),(20,1),(21,1),(22,1),(23,1),(24,1),(26,1),(27,1),(28,1),(29,1),(30,1),(31,1),(32,1),(33,1),(34,1),(35,1),(36,1),(37,1),(38,1),(39,1),(40,1),(41,1),(42,1),(44,1),(45,1),(46,1),(47,1),(48,1),(49,1),(50,1),(51,1),(52,1),(53,1),(54,1),(56,1),(57,1),(58,1),(59,1),(60,1),(62,1),(63,1),(64,1),(65,1),(66,1),(67,1),(68,1),(70,1),(71,1),(72,1),(73,1),(74,1),(75,1),(76,1),(77,1),(78,1),(79,1),(36,2),(42,2),(45,2),(48,2),(49,2),(50,2),(51,2),(52,2),(53,2),(54,2),(57,2),(60,2),(63,2),(66,2),(67,2),(48,3),(49,3),(50,3),(51,3),(52,3),(53,3),(66,3),(67,3),(76,3),(48,4),(49,4),(50,4),(51,4),(52,4),(53,4),(66,4),(67,4),(76,4);

--
-- Table structure for table `references`
--

CREATE TABLE `references` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `from_id` int unsigned NOT NULL,
  `from_type` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  `to_id` int unsigned NOT NULL,
  `to_type` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `references_from_id_index` (`from_id`),
  KEY `references_from_type_index` (`from_type`),
  KEY `references_to_id_index` (`to_id`),
  KEY `references_to_type_index` (`to_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `references`
--


--
-- Table structure for table `role_permissions`
--

CREATE TABLE `role_permissions` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) 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 AUTO_INCREMENT=80 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `role_permissions`
--

INSERT INTO `role_permissions` VALUES (19,'settings-manage','Manage Settings',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(20,'users-manage','Manage Users',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(21,'user-roles-manage','Manage Roles & Permissions',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(22,'restrictions-manage-all','Manage All Entity Permissions',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(23,'restrictions-manage-own','Manage Entity Permissions On Own Content',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(24,'book-create-all','Create All Books',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(25,'book-create-own','Create Own Books',NULL,'2024-11-30 21:18:16','2024-11-30 21:18:16'),(26,'book-update-all','Update All Books',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(27,'book-update-own','Update Own Books',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(28,'book-delete-all','Delete All Books',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(29,'book-delete-own','Delete Own Books',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(30,'page-create-all','Create All Pages',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(31,'page-create-own','Create Own Pages',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(32,'page-update-all','Update All Pages',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(33,'page-update-own','Update Own Pages',NULL,'2024-11-30 21:18:17','2024-11-30 21:18:17'),(34,'page-delete-all','Delete All Pages',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(35,'page-delete-own','Delete Own Pages',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(36,'chapter-create-all','Create All Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(37,'chapter-create-own','Create Own Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(38,'chapter-update-all','Update All Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(39,'chapter-update-own','Update Own Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(40,'chapter-delete-all','Delete All Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(41,'chapter-delete-own','Delete Own Chapters',NULL,'2024-11-30 21:18:18','2024-11-30 21:18:18'),(42,'image-create-all','Create All Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(43,'image-create-own','Create Own Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(44,'image-update-all','Update All Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(45,'image-update-own','Update Own Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(46,'image-delete-all','Delete All Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(47,'image-delete-own','Delete Own Images',NULL,'2024-11-30 21:18:19','2024-11-30 21:18:19'),(48,'book-view-all','View All Books',NULL,'2024-11-30 21:18:23','2024-11-30 21:18:23'),(49,'book-view-own','View Own Books',NULL,'2024-11-30 21:18:23','2024-11-30 21:18:23'),(50,'page-view-all','View All Pages',NULL,'2024-11-30 21:18:24','2024-11-30 21:18:24'),(51,'page-view-own','View Own Pages',NULL,'2024-11-30 21:18:24','2024-11-30 21:18:24'),(52,'chapter-view-all','View All Chapters',NULL,'2024-11-30 21:18:24','2024-11-30 21:18:24'),(53,'chapter-view-own','View Own Chapters',NULL,'2024-11-30 21:18:24','2024-11-30 21:18:24'),(54,'attachment-create-all','Create All Attachments',NULL,'2024-11-30 21:18:31','2024-11-30 21:18:31'),(55,'attachment-create-own','Create Own Attachments',NULL,'2024-11-30 21:18:31','2024-11-30 21:18:31'),(56,'attachment-update-all','Update All Attachments',NULL,'2024-11-30 21:18:31','2024-11-30 21:18:31'),(57,'attachment-update-own','Update Own Attachments',NULL,'2024-11-30 21:18:31','2024-11-30 21:18:31'),(58,'attachment-delete-all','Delete All Attachments',NULL,'2024-11-30 21:18:31','2024-11-30 21:18:31'),(59,'attachment-delete-own','Delete Own Attachments',NULL,'2024-11-30 21:18:32','2024-11-30 21:18:32'),(60,'comment-create-all','Create All Comments',NULL,'2024-11-30 21:18:37','2024-11-30 21:18:37'),(61,'comment-create-own','Create Own Comments',NULL,'2024-11-30 21:18:37','2024-11-30 21:18:37'),(62,'comment-update-all','Update All Comments',NULL,'2024-11-30 21:18:37','2024-11-30 21:18:37'),(63,'comment-update-own','Update Own Comments',NULL,'2024-11-30 21:18:37','2024-11-30 21:18:37'),(64,'comment-delete-all','Delete All Comments',NULL,'2024-11-30 21:18:37','2024-11-30 21:18:37'),(65,'comment-delete-own','Delete Own Comments',NULL,'2024-11-30 21:18:38','2024-11-30 21:18:38'),(66,'bookshelf-view-all','View All BookShelves',NULL,'2024-11-30 21:18:46','2024-11-30 21:18:46'),(67,'bookshelf-view-own','View Own BookShelves',NULL,'2024-11-30 21:18:46','2024-11-30 21:18:46'),(68,'bookshelf-create-all','Create All BookShelves',NULL,'2024-11-30 21:18:46','2024-11-30 21:18:46'),(69,'bookshelf-create-own','Create Own BookShelves',NULL,'2024-11-30 21:18:46','2024-11-30 21:18:46'),(70,'bookshelf-update-all','Update All BookShelves',NULL,'2024-11-30 21:18:47','2024-11-30 21:18:47'),(71,'bookshelf-update-own','Update Own BookShelves',NULL,'2024-11-30 21:18:47','2024-11-30 21:18:47'),(72,'bookshelf-delete-all','Delete All BookShelves',NULL,'2024-11-30 21:18:47','2024-11-30 21:18:47'),(73,'bookshelf-delete-own','Delete Own BookShelves',NULL,'2024-11-30 21:18:47','2024-11-30 21:18:47'),(74,'templates-manage','Manage Page Templates',NULL,'2024-11-30 21:18:47','2024-11-30 21:18:47'),(75,'access-api','Access system API',NULL,'2024-11-30 21:18:50','2024-11-30 21:18:50'),(76,'content-export','Export Content',NULL,'2024-11-30 21:19:01','2024-11-30 21:19:01'),(77,'editor-change','Change page editor',NULL,'2024-11-30 21:19:05','2024-11-30 21:19:05'),(78,'receive-notifications','Receive & Manage Notifications',NULL,'2024-11-30 21:19:17','2024-11-30 21:19:17'),(79,'language-translation-manage','Manage Language & Translations',NULL,'2024-12-28 13:25:13',NULL);

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

CREATE TABLE `role_user` (
  `user_id` int unsigned NOT NULL,
  `role_id` int 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,1),(3,2),(5,3),(2,4),(4,4);

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

CREATE TABLE `roles` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `display_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `system_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `external_auth_id` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `mfa_enforced` tinyint(1) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `roles_system_name_index` (`system_name`),
  KEY `roles_external_auth_id_index` (`external_auth_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `roles` VALUES (1,'Admin','Administrator of the whole application','2024-11-30 21:18:05','2024-11-30 21:18:05','admin','',0),(2,'Editor','User can edit Books, Chapters & Pages','2024-11-30 21:18:05','2024-11-30 21:18:05','','',0),(3,'Viewer','User can view books & their content behind authentication','2024-11-30 21:18:06','2024-11-30 21:18:06','','',0),(4,'Public','The role given to public visitors if allowed','2024-11-30 21:18:28','2024-11-30 21:18:28','public','',0);

--
-- Table structure for table `search_terms`
--

CREATE TABLE `search_terms` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `term` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` int NOT NULL,
  `score` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `search_terms_term_index` (`term`),
  KEY `search_terms_entity_type_index` (`entity_type`),
  KEY `search_terms_entity_type_entity_id_index` (`entity_type`,`entity_id`),
  KEY `search_terms_score_index` (`score`)
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `search_terms`
--

INSERT INTO `search_terms` VALUES (1,'New','book',1,49),(2,'test','book',1,49),(3,'book','book',1,49),(4,'Chapter1','chapter',1,49),(5,'Tag1','chapter',1,3),(6,'Economy','chapter',1,5),(14,'Page','page',1,41),(15,'1','page',1,41),(16,'test','page',1,42),(17,'2','page',1,1),(18,' ','page',1,1),(19,'كتب','bookshelf',1,48),(20,'دينية','bookshelf',1,48),(21,'رف','bookshelf',1,1),(22,'الكتب','bookshelf',1,1),(23,'الدينية','bookshelf',1,1),(24,'كتب','bookshelf',2,49),(25,'أدبية','bookshelf',2,49),(26,'وروايات','bookshelf',2,49),(27,'هنا','bookshelf',2,1),(28,'رواية','book',2,57),(29,'جديدة','book',2,52),(30,'هنا','book',2,1),(31,'اسم','book',2,3),(32,'الوسم','book',2,8),(33,'الفصل','chapter',2,48),(34,'الاول','chapter',2,49),(35,'وصف','chapter',2,1),(36,'الوصف','chapter',2,1),(37,'جورج','chapter',2,8),(38,'عبدالرحمن','chapter',2,3),(39,'شخصية','chapter',2,5),(40,'عبدالرحم','chapter',2,5),(41,'الفصل','chapter',3,49),(42,'الثاني','chapter',3,49),(43,'وصف','chapter',3,1),(44,'الخادمة','chapter',3,3),(45,'عادات','chapter',3,8),(46,'سنية','chapter',3,5),(47,'صينية','chapter',3,5),(56,'موقف','page',3,40),(57,'في','page',3,40),(58,'البرازيل','page',3,40),(59,'هلق','page',3,1),(60,'تةبقن','page',3,1),(61,'الللل','page',3,1),(62,'موقف','page',2,40),(63,'في','page',2,40),(64,'الصين','page',2,40),(65,'كان','page',2,1),(66,'هذا','page',2,1),(67,'الموقف','page',2,1),(68,'أمر','page',2,1),(69,'عظيم','page',2,1),(70,' ','page',2,1),(71,'تعديل','page',2,1),(72,'من','page',2,1),(73,'المحرر','page',2,1),(93,'New','page',6,40),(94,'page','page',6,40),(95,'2','page',6,40),(96,'Chapter','chapter',4,48),(97,'2','chapter',4,48),(98,'Page1','page',7,40),(99,'chapter','page',7,40),(100,'2','page',7,40),(120,'اقتراحاتك','page',4,40),(121,'هنا','page',4,41),(122,'اذا','page',4,1),(123,'كنت','page',4,1),(124,'تريد','page',4,1),(125,'اضافةفصل','page',4,1),(126,'أو','page',4,2),(127,'صفحة','page',4,1),(128,'جديدا','page',4,2),(129,'بابا','page',4,1),(130,'رجاء','page',4,1),(131,'الاقتراح','page',4,1),(132,'لكن','page',4,1),(133,'تاكد','page',4,1),(134,'من','page',4,1),(135,'قراءتك','page',4,1),(136,'الجيدة','page',4,1),(137,'لجميع','page',4,1),(138,'الفصول','page',4,1);

--
-- Table structure for table `sessions`
--

CREATE TABLE `sessions` (
  `id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  UNIQUE KEY `sessions_id_unique` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `sessions`
--


--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `setting_key` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'string',
  PRIMARY KEY (`setting_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `settings`
--

INSERT INTO `settings` VALUES ('app-color','#206ea7','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-color-dark','#195785','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-color-light','rgba(32,110,167,0.15)','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-color-light-dark','rgba(32,110,167,0.15)','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-custom-head','','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-editor','wysiwyg','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-footer-links','[]','2024-12-10 10:54:46','2024-12-10 10:54:46','array'),('app-homepage','','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-homepage-type','default','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-name','Khalaef','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('app-name-header','false','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('book-color','#077b70','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('book-color-dark','#389f60','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('bookshelf-color','#a94747','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('bookshelf-color-dark','#ff5454','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('chapter-color','#af4d0d','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('chapter-color-dark','#ee7a2d','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('link-color','#206ea7','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('link-color-dark','#429fe3','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('page-color','#206ea7','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('page-color-dark','#429fe3','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('page-draft-color','#7e50b1','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('page-draft-color-dark','#a66ce8','2024-12-10 10:54:46','2024-12-10 10:54:46','string'),('user:1:books_view_type','grid','2024-12-01 04:53:00','2024-12-01 04:53:02','string'),('user:1:bookshelves_sort','name','2025-01-12 01:18:51','2025-01-12 01:18:51','string'),('user:1:bookshelves_sort_order','asc','2025-01-12 01:18:51','2025-01-12 01:19:01','string'),('user:1:dark-mode-enabled','true','2025-01-12 03:50:35','2025-01-12 03:50:35','string'),('user:1:section_expansion#home-details','false','2024-12-01 04:52:52','2025-01-12 03:50:34','string'),('user:3:bookshelf_view_type','list','2025-01-12 03:13:09','2025-01-12 03:13:09','string'),('user:3:language','ar','2025-01-12 01:41:33','2025-01-12 01:41:33','string'),('user:4:language','ar','2025-01-12 01:53:45','2025-01-12 01:53:45','string'),('user:5:language','ar','2025-01-12 01:55:31','2025-01-12 01:55:31','string');

--
-- Table structure for table `social_accounts`
--

CREATE TABLE `social_accounts` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `driver` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `driver_id` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `avatar` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `social_accounts_user_id_index` (`user_id`),
  KEY `social_accounts_driver_index` (`driver`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `social_accounts`
--


--
-- Table structure for table `tags`
--

CREATE TABLE `tags` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `entity_id` int NOT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `value` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `tags_name_index` (`name`),
  KEY `tags_value_index` (`value`),
  KEY `tags_order_index` (`order`),
  KEY `tags_entity_id_entity_type_index` (`entity_id`,`entity_type`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tags`
--

INSERT INTO `tags` VALUES (1,1,'chapter','Tag1','Economy',0,'2024-12-09 05:06:00','2024-12-09 05:06:00'),(2,2,'book','رواية جديدة','رواية',0,'2025-01-12 01:23:43','2025-01-12 01:23:43'),(3,2,'book','اسم الوسم','الوسم',0,'2025-01-12 01:23:43','2025-01-12 01:23:43'),(4,2,'chapter','جورج','جورج',0,'2025-01-12 01:25:54','2025-01-12 01:25:54'),(5,2,'chapter','عبدالرحمن','شخصية عبدالرحم',0,'2025-01-12 01:25:54','2025-01-12 01:25:54'),(6,3,'chapter','الخادمة','سنية',0,'2025-01-12 01:28:20','2025-01-12 01:28:20'),(7,3,'chapter','عادات','عادات صينية',0,'2025-01-12 01:28:20','2025-01-12 01:28:20');

--
-- Table structure for table `views`
--

CREATE TABLE `views` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `viewable_id` int NOT NULL,
  `viewable_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `views` int NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `views_user_id_index` (`user_id`),
  KEY `views_viewable_id_index` (`viewable_id`),
  KEY `views_updated_at_index` (`updated_at`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `views`
--

INSERT INTO `views` VALUES (1,1,1,'book',8,'2024-12-09 05:04:51','2025-01-21 01:20:36'),(2,1,1,'chapter',7,'2024-12-09 05:06:01','2025-01-21 02:59:36'),(3,1,1,'page',13,'2024-12-09 05:06:39','2024-12-21 04:00:15'),(4,1,1,'bookshelf',1,'2025-01-12 01:18:01','2025-01-12 01:18:01'),(5,1,2,'bookshelf',3,'2025-01-12 01:20:32','2025-01-12 01:20:59'),(6,1,2,'book',20,'2025-01-12 01:23:43','2025-01-12 02:45:55'),(7,1,2,'chapter',12,'2025-01-12 01:25:54','2025-01-12 02:33:18'),(8,1,3,'chapter',1,'2025-01-12 01:28:20','2025-01-12 01:28:20'),(9,1,2,'page',7,'2025-01-12 01:29:29','2025-01-12 02:45:53'),(10,1,3,'page',2,'2025-01-12 01:30:31','2025-01-21 01:20:16'),(11,3,3,'page',2,'2025-01-12 01:46:12','2025-01-12 02:29:19'),(12,3,2,'book',4,'2025-01-12 01:49:16','2025-01-12 04:58:07'),(13,3,2,'chapter',4,'2025-01-12 01:49:18','2025-01-12 02:29:04'),(14,3,2,'page',9,'2025-01-12 01:49:19','2025-01-12 02:16:14'),(15,3,2,'bookshelf',2,'2025-01-12 02:28:30','2025-01-12 04:02:20'),(16,1,4,'page',4,'2025-01-12 02:31:29','2025-01-21 01:20:05'),(17,1,6,'page',2,'2025-01-12 02:34:34','2025-01-12 03:41:22'),(18,1,4,'chapter',4,'2025-01-12 02:35:14','2025-01-17 14:41:52'),(19,1,7,'page',4,'2025-01-12 02:35:43','2025-01-17 14:41:41'),(20,3,4,'page',2,'2025-01-12 02:46:53','2025-01-12 02:47:19'),(21,3,1,'bookshelf',3,'2025-01-12 03:12:58','2025-01-12 03:13:14');

--
-- Table structure for table `watches`
--

CREATE TABLE `watches` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `watchable_id` int NOT NULL,
  `watchable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `level` tinyint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `watchable_index` (`watchable_id`,`watchable_type`),
  KEY `watches_user_id_index` (`user_id`),
  KEY `watches_level_index` (`level`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `watches`
--

INSERT INTO `watches` VALUES (1,1,2,'book',2,'2025-01-12 02:43:50','2025-01-12 02:43:50');

--
-- Table structure for table `webhook_tracked_events`
--

CREATE TABLE `webhook_tracked_events` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `webhook_id` int NOT NULL,
  `event` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhook_tracked_events_event_index` (`event`),
  KEY `webhook_tracked_events_webhook_id_index` (`webhook_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `webhook_tracked_events`
--


--
-- Table structure for table `webhooks`
--

CREATE TABLE `webhooks` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `active` tinyint(1) NOT NULL,
  `endpoint` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `timeout` int unsigned NOT NULL DEFAULT '3',
  `last_error` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_called_at` timestamp NULL DEFAULT NULL,
  `last_errored_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `webhooks_name_index` (`name`),
  KEY `webhooks_active_index` (`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `webhooks`
--



