hyperf-chat/migrations/2020_11_04_153541_create_us...

35 lines
934 B
PHP
Raw Normal View History

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-08-27 23:50:40 +08:00
2020-11-04 16:47:17 +08:00
class CreateUsersEmoticonTable extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('users_emoticon', function (Blueprint $table) {
$table->unsignedInteger('id', true)->comment('表情包收藏ID');
2021-08-01 19:57:41 +08:00
$table->unsignedInteger('user_id')->default(0)->comment('用户ID');
2020-11-04 16:47:17 +08:00
$table->string('emoticon_ids', 255)->default('')->comment('表情包ID');
2021-08-27 23:50:40 +08:00
$table->charset = 'utf8';
2020-11-04 16:47:17 +08:00
$table->collation = 'utf8_general_ci';
2021-08-01 19:57:41 +08:00
$table->unique(['user_id'], 'uk_user_id');
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
{
Schema::dropIfExists('users_emoticon');
}
}