feature #1

Merged
XiaoLFeng merged 27 commits from feature into master 2023-06-15 16:08:34 +08:00
3 changed files with 128 additions and 0 deletions
Showing only changes of commit 7740802940 - Show all commits

View File

@ -0,0 +1,38 @@
<?php
/*
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
* 开发开源遵循 MIT 许可,若需商用请联系开发者
* https://www.x-lf.com/
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateInfoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('info', function (Blueprint $table) {
$table->id();
$table->string('value')->comment('参数名字');
$table->text('data')->nullable()->comment('参数内容');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('info');
}
}

View File

@ -0,0 +1,52 @@
<?php
/*
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
* 开发开源遵循 MIT 许可,若需商用请联系开发者
* https://www.x-lf.com/
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class UpdateInfoTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('info', function (Blueprint $table) {
// 构建数据
DB::table('info')->insert(['value' => 'title', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'description', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'subTitle', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'subTitleDescription', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'icon', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'keyword', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'webHeader', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'webFooter', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'aboutMe', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'icp', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'gongan', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'author', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'copyRightYear', 'created_at' => date('Y-m-d H:i:s')]);
DB::table('info')->insert(['value' => 'blog', 'created_at' => date('Y-m-d H:i:s')]);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('info', function (Blueprint $table) {
//
});
}
}

View File

@ -0,0 +1,38 @@
<?php
/*
* Copyright © 2016 - 2023 筱锋xiao_lfeng. All Rights Reserved.
* 开发开源遵循 MIT 许可,若需商用请联系开发者
* https://www.x-lf.com/
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBlogSortTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('blog_sort', function (Blueprint $table) {
$table->id();
$table->integer('sort')->comment('排序(数字越小权限越大)');
$table->string('title')->comment('标题');
$table->text('description')->comment('描述')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('blog_sort');
}
}