feature #1
38
database/migrations/2023_06_13_052650_create_info_table.php
Normal file
38
database/migrations/2023_06_13_052650_create_info_table.php
Normal 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');
|
||||
}
|
||||
}
|
52
database/migrations/2023_06_13_060913_update_info_table.php
Normal file
52
database/migrations/2023_06_13_060913_update_info_table.php
Normal 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) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user