From 2516de70d6237205f5e6863eb9d2c7842498184c Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Fri, 16 Jun 2023 16:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=9A=E5=AE=A2=E9=A2=9C=E8=89=B2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=BF=81=E7=A7=BB=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...3_06_16_075646_create_blog_color_table.php | 39 ++++++++++ ...3_06_16_075950_update_blog_color_table.php | 77 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 database/migrations/2023_06_16_075646_create_blog_color_table.php create mode 100644 database/migrations/2023_06_16_075950_update_blog_color_table.php diff --git a/database/migrations/2023_06_16_075646_create_blog_color_table.php b/database/migrations/2023_06_16_075646_create_blog_color_table.php new file mode 100644 index 0000000..ee730e8 --- /dev/null +++ b/database/migrations/2023_06_16_075646_create_blog_color_table.php @@ -0,0 +1,39 @@ +id(); + $table->boolean('onlyAdminUse')->default(0)->comment('只允许管理员使用'); + $table->string('colorLightType')->default('text-gray-500')->comment('颜色ID'); + $table->string('colorDarkType')->default('dark:text-gray-800')->comment('暗色颜色ID'); + $table->string('comment')->nullable()->comment('备注'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('blog_color'); + } +} diff --git a/database/migrations/2023_06_16_075950_update_blog_color_table.php b/database/migrations/2023_06_16_075950_update_blog_color_table.php new file mode 100644 index 0000000..0607c20 --- /dev/null +++ b/database/migrations/2023_06_16_075950_update_blog_color_table.php @@ -0,0 +1,77 @@ +insert([ + 'colorLightType' => 'text-gray-500', + 'colorDarkType' => 'dark:text-gray-800', + 'comment' => '灰色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-blue-500', + 'colorDarkType' => 'dark:text-blue-800', + 'comment' => '蓝色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-indigo-500', + 'colorDarkType' => 'dark:text-indigo-800', + 'comment' => '靛青色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-purple-500', + 'colorDarkType' => 'dark:text-purple-800', + 'comment' => '紫色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-pink-500', + 'colorDarkType' => 'dark:text-pink-800', + 'comment' => '粉色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-green-500', + 'colorDarkType' => 'dark:text-green-800', + 'comment' => '绿色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-yellow-500', + 'colorDarkType' => 'dark:text-yellow-800', + 'comment' => '蓝色' + ]); + DB::table('blog_color')->insert([ + 'colorLightType' => 'text-red-500', + 'colorDarkType' => 'dark:text-red-800', + 'comment' => '红色' + ]); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('blog_color', function (Blueprint $table) { + // + }); + } +}