Store media:ID in article bodies instead of CDN URLs, and keep sablog attach tokens as a fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
566 lines
30 KiB
SQL
566 lines
30 KiB
SQL
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
|
DROP TABLE IF EXISTS `activity_log`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `activity_log` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`log_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`subject_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`event` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`subject_id` bigint unsigned DEFAULT NULL,
|
|
`causer_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`causer_id` bigint unsigned DEFAULT NULL,
|
|
`properties` json DEFAULT NULL,
|
|
`batch_uuid` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `subject` (`subject_type`,`subject_id`),
|
|
KEY `causer` (`causer_type`,`causer_id`),
|
|
KEY `activity_log_log_name_index` (`log_name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `article_membership`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `article_membership` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`article_id` bigint unsigned NOT NULL,
|
|
`enabled` tinyint(1) NOT NULL DEFAULT '0',
|
|
`required_plan_id` bigint unsigned DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `article_membership_article_id_unique` (`article_id`),
|
|
KEY `article_membership_required_plan_id_foreign` (`required_plan_id`),
|
|
CONSTRAINT `article_membership_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `article_membership_required_plan_id_foreign` FOREIGN KEY (`required_plan_id`) REFERENCES `membership_plans` (`id`) ON DELETE RESTRICT
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `article_products`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `article_products` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`article_id` bigint unsigned NOT NULL,
|
|
`enabled` tinyint(1) NOT NULL DEFAULT '0',
|
|
`price` decimal(10,2) NOT NULL,
|
|
`currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CNY',
|
|
`trial_mode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'chars',
|
|
`trial_value` int unsigned NOT NULL DEFAULT '200',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `article_products_article_id_unique` (`article_id`),
|
|
CONSTRAINT `article_products_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `article_tag`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `article_tag` (
|
|
`article_id` bigint unsigned NOT NULL,
|
|
`tag_id` bigint unsigned NOT NULL,
|
|
UNIQUE KEY `article_tag_article_id_tag_id_unique` (`article_id`,`tag_id`),
|
|
KEY `article_tag_tag_id_foreign` (`tag_id`),
|
|
CONSTRAINT `article_tag_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `article_tag_tag_id_foreign` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `articles`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `articles` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`category_id` bigint unsigned NOT NULL,
|
|
`user_id` bigint unsigned NOT NULL,
|
|
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`content_format` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'html',
|
|
`description` text COLLATE utf8mb4_unicode_ci,
|
|
`keywords` text COLLATE utf8mb4_unicode_ci,
|
|
`published_at` timestamp NULL DEFAULT NULL,
|
|
`views` bigint unsigned NOT NULL DEFAULT '0',
|
|
`comments_count` int unsigned NOT NULL DEFAULT '0',
|
|
`slug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`stick` tinyint(1) NOT NULL DEFAULT '0',
|
|
`visible` tinyint(1) NOT NULL DEFAULT '1',
|
|
`close_comment` tinyint(1) NOT NULL DEFAULT '0',
|
|
`read_password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`ai_summary` text COLLATE utf8mb4_unicode_ci,
|
|
`ai_suggestions` json DEFAULT NULL,
|
|
`ai_polished_content` longtext COLLATE utf8mb4_unicode_ci,
|
|
`legacy_attachments` json DEFAULT NULL,
|
|
`cover_disk` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`cover_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`cover_source` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
|
|
`cover_status` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none',
|
|
`cover_generated_at` timestamp NULL DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `articles_slug_unique` (`slug`),
|
|
KEY `articles_user_id_foreign` (`user_id`),
|
|
KEY `articles_visible_published_at_index` (`visible`,`published_at`),
|
|
KEY `articles_category_id_index` (`category_id`),
|
|
CONSTRAINT `articles_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `articles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `attachments`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `attachments` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`article_id` bigint unsigned DEFAULT NULL,
|
|
`disk` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'attachments',
|
|
`path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`thumb_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`filename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`mime` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`size` bigint unsigned NOT NULL DEFAULT '0',
|
|
`checksum` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`visibility` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'public',
|
|
`legacy_filepath` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`synced_at` timestamp NULL DEFAULT NULL,
|
|
`downloads` bigint unsigned NOT NULL DEFAULT '0',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `attachments_article_id_foreign` (`article_id`),
|
|
KEY `attachments_legacy_filepath_index` (`legacy_filepath`),
|
|
CONSTRAINT `attachments_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE SET NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `cache`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `cache` (
|
|
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`expiration` int NOT NULL,
|
|
PRIMARY KEY (`key`),
|
|
KEY `cache_expiration_index` (`expiration`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `cache_locks`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `cache_locks` (
|
|
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`expiration` int NOT NULL,
|
|
PRIMARY KEY (`key`),
|
|
KEY `cache_locks_expiration_index` (`expiration`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `categories`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `categories` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`intro` text COLLATE utf8mb4_unicode_ci,
|
|
`keywords` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`cover_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`display_order` int NOT NULL DEFAULT '0',
|
|
`articles_count` int unsigned NOT NULL DEFAULT '0',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `comments`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `comments` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`article_id` bigint unsigned NOT NULL,
|
|
`author` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`moderation_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
|
|
`published_at` timestamp NULL DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `comments_article_id_foreign` (`article_id`),
|
|
CONSTRAINT `comments_article_id_foreign` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `entitlements`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `entitlements` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` bigint unsigned NOT NULL,
|
|
`product_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`product_id` bigint unsigned NOT NULL,
|
|
`source_order_id` bigint unsigned DEFAULT NULL,
|
|
`granted_at` timestamp NOT NULL,
|
|
`revoked_at` timestamp NULL DEFAULT NULL,
|
|
`expires_at` timestamp NULL DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `entitlements_user_id_product_type_product_id_unique` (`user_id`,`product_type`,`product_id`),
|
|
CONSTRAINT `entitlements_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `failed_jobs`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `job_batches`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `job_batches` (
|
|
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`total_jobs` int NOT NULL,
|
|
`pending_jobs` int NOT NULL,
|
|
`failed_jobs` int NOT NULL,
|
|
`failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`options` mediumtext COLLATE utf8mb4_unicode_ci,
|
|
`cancelled_at` int DEFAULT NULL,
|
|
`created_at` int NOT NULL,
|
|
`finished_at` int DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `jobs`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `jobs` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`queue` varchar(255) 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 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `links`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `links` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`note` text COLLATE utf8mb4_unicode_ci,
|
|
`display_order` int NOT NULL DEFAULT '0',
|
|
`visible` tinyint(1) NOT NULL DEFAULT '1',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `membership_plans`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `membership_plans` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`description` text COLLATE utf8mb4_unicode_ci,
|
|
`price` decimal(10,2) NOT NULL,
|
|
`currency` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CNY',
|
|
`duration_days` int unsigned DEFAULT NULL,
|
|
`enabled` tinyint(1) NOT NULL DEFAULT '1',
|
|
`sort_order` int NOT NULL DEFAULT '0',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `membership_plans_slug_unique` (`slug`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `migrations`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `model_has_permissions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `model_has_roles`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `order_items`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `order_items` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`order_id` bigint unsigned NOT NULL,
|
|
`product_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`product_id` bigint unsigned NOT NULL,
|
|
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`amount` decimal(10,2) NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `order_items_order_id_foreign` (`order_id`),
|
|
CONSTRAINT `order_items_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `orders`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `orders` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`user_id` bigint unsigned NOT NULL,
|
|
`status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`amount` decimal(10,2) NOT NULL,
|
|
`currency` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'CNY',
|
|
`gateway` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`paid_at` timestamp NULL DEFAULT NULL,
|
|
`meta` json DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `orders_user_id_foreign` (`user_id`),
|
|
CONSTRAINT `orders_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `password_reset_tokens`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `password_reset_tokens` (
|
|
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`email`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `payment_transactions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `payment_transactions` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`order_id` bigint unsigned NOT NULL,
|
|
`gateway` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`external_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`payload` json DEFAULT NULL,
|
|
`status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `payment_transactions_order_id_foreign` (`order_id`),
|
|
CONSTRAINT `payment_transactions_order_id_foreign` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `permissions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `plugins`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `plugins` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`version` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1.0.0',
|
|
`enabled` tinyint(1) NOT NULL DEFAULT '0',
|
|
`path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`config` json DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `plugins_name_unique` (`name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `role_has_permissions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
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;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `roles`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `roles` (
|
|
`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 `roles_name_guard_name_unique` (`name`,`guard_name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `sessions`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `sessions` (
|
|
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`user_id` bigint unsigned DEFAULT NULL,
|
|
`ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`user_agent` text COLLATE utf8mb4_unicode_ci,
|
|
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`last_activity` int NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
KEY `sessions_user_id_index` (`user_id`),
|
|
KEY `sessions_last_activity_index` (`last_activity`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `settings`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `settings` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`group` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`locked` tinyint(1) NOT NULL DEFAULT '0',
|
|
`payload` json NOT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `settings_group_name_unique` (`group`,`name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `stylevars`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `stylevars` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`value` text COLLATE utf8mb4_unicode_ci,
|
|
`visible` tinyint(1) NOT NULL DEFAULT '1',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `tags`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `tags` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`use_count` int unsigned NOT NULL DEFAULT '0',
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `tags_name_unique` (`name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
DROP TABLE IF EXISTS `users`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!50503 SET character_set_client = utf8mb4 */;
|
|
CREATE TABLE `users` (
|
|
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
`username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`email_verified_at` timestamp NULL DEFAULT NULL,
|
|
`password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`password_legacy` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`login_count` int unsigned NOT NULL DEFAULT '0',
|
|
`login_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`login_at` timestamp NULL DEFAULT NULL,
|
|
`reg_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`last_post_at` timestamp NULL DEFAULT NULL,
|
|
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
`created_at` timestamp NULL DEFAULT NULL,
|
|
`updated_at` timestamp NULL DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `users_email_unique` (`email`),
|
|
UNIQUE KEY `users_username_unique` (`username`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
|
|
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
|
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'0001_01_01_000000_create_users_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'0001_01_01_000001_create_cache_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'0001_01_01_000002_create_jobs_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2022_12_14_083707_create_settings_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2026_08_11_092526_create_permission_tables',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2026_08_11_092528_create_activity_log_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2026_08_11_092529_add_event_column_to_activity_log_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2026_08_11_092530_add_batch_uuid_column_to_activity_log_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2026_08_11_100000_create_blog_tables',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2026_08_11_100001_create_larablog_settings',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2026_08_11_100002_add_attachments_url_prefix_setting',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2026_08_11_100003_drop_trackback_legacy',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2026_08_11_100003_remove_trackback_setting',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2026_08_11_100004_add_article_content_format',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2026_08_11_100004_add_content_format_settings',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2026_08_11_100005_add_article_cover_placeholders',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2026_08_11_220000_expand_blog_comment_settings',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2026_08_11_230000_create_snippet_settings',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2026_08_12_001000_create_orders_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2026_08_12_001001_create_order_items_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2026_08_12_001002_create_entitlements_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2026_08_12_001003_create_payment_transactions_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2026_08_12_002000_create_article_products_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2026_08_12_013201_add_article_ai_polished_content',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2026_08_12_034500_add_expires_at_to_entitlements_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2026_08_12_034600_create_membership_plans_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2026_08_12_034601_create_article_membership_table',1);
|
|
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2026_08_13_015800_add_category_seo_fields',1);
|