39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
||
|
||
use Illuminate\Database\Migrations\Migration;
|
||
use Illuminate\Database\Schema\Blueprint;
|
||
use Illuminate\Support\Facades\Schema;
|
||
|
||
class CreateMessagesTable extends Migration
|
||
{
|
||
/**
|
||
* Run the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function up()
|
||
{
|
||
Schema::create('messages', function (Blueprint $table) {
|
||
$table->id();
|
||
$table->string('title')->comment('消息标题');
|
||
$table->text('content')->comment('消息内容');
|
||
$table->unsignedTinyInteger('type')->default(0)->comment('消息类型:0公告,1订单确认');
|
||
$table->unsignedBigInteger('user_id')->default(0)->comment('指定用户');
|
||
$table->json('ext')->nullable()->comment('消息扩展内容');
|
||
$table->tinyInteger('jump_type')->default(0)->comment('跳转类型:0不跳转,1跳转应用内页,2H5链接');
|
||
$table->string('jump_link')->nullable()->comment('跳转地址');
|
||
$table->timestamps();
|
||
});
|
||
}
|
||
|
||
/**
|
||
* Reverse the migrations.
|
||
*
|
||
* @return void
|
||
*/
|
||
public function down()
|
||
{
|
||
Schema::dropIfExists('messages');
|
||
}
|
||
}
|