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) { + // + }); + } +}