2020-11-04 16:47:17 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Hyperf\Database\Schema\Schema;
|
|
|
|
|
use Hyperf\Database\Schema\Blueprint;
|
|
|
|
|
use Hyperf\Database\Migrations\Migration;
|
2021-07-05 21:52:44 +08:00
|
|
|
|
|
|
|
|
|
class CreateEmoticonItemTable extends Migration
|
2020-11-04 16:47:17 +08:00
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*/
|
|
|
|
|
public function up(): void
|
|
|
|
|
{
|
2021-07-05 21:52:44 +08:00
|
|
|
|
Schema::create('emoticon_item', function (Blueprint $table) {
|
|
|
|
|
$table->unsignedInteger('id', true)->comment('表情包详情ID');
|
2020-11-04 16:47:17 +08:00
|
|
|
|
$table->unsignedInteger('emoticon_id')->default(0)->comment('表情分组ID');
|
|
|
|
|
$table->unsignedInteger('user_id')->default(0)->comment('用户ID(0:代码系统表情包)');
|
2021-07-05 21:52:44 +08:00
|
|
|
|
$table->string('describe', 20)->default('')->comment('表情描述');
|
|
|
|
|
$table->string('url', 255)->default('')->comment('图片链接');
|
2020-11-04 16:47:17 +08:00
|
|
|
|
$table->string('file_suffix', 10)->default('')->comment('文件后缀名');
|
|
|
|
|
$table->unsignedBigInteger('file_size')->default(0)->comment('文件大小(单位字节)');
|
2021-07-05 21:52:44 +08:00
|
|
|
|
$table->dateTime('created_at')->nullable()->comment('创建时间');
|
|
|
|
|
$table->dateTime('updated_at')->nullable()->comment('更新时间');
|
2020-11-04 16:47:17 +08:00
|
|
|
|
|
2021-07-05 21:52:44 +08:00
|
|
|
|
$table->charset = 'utf8';
|
2020-11-04 16:47:17 +08:00
|
|
|
|
$table->collation = 'utf8_general_ci';
|
2021-08-27 23:50:40 +08:00
|
|
|
|
$table->comment('表情包详情表');
|
2020-11-04 16:47:17 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*/
|
|
|
|
|
public function down(): void
|
|
|
|
|
{
|
2021-07-05 21:52:44 +08:00
|
|
|
|
Schema::dropIfExists('emoticon_item');
|
2020-11-04 16:47:17 +08:00
|
|
|
|
}
|
|
|
|
|
}
|