46 lines
1.4 KiB
PHP
46 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
class CreateCardsTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
if (Schema::hasTable('cards')) {
|
|
return;
|
|
}
|
|
|
|
Schema::create('cards', function (Blueprint $table) {
|
|
$table->bigInteger('sim')->unsigned()->default(0)->comment('sim号');
|
|
$table->string('imsi', 32)->default('')->comment('imsi号');
|
|
$table->string('iccid', 32)->default('')->comment('iccid号');
|
|
$table->integer('bloc_id')->unsigned()->default(0)->comment('来源集团ID');
|
|
$table->tinyInteger('carrier_operator')->unsigned()->default(255)->comment('运营商(0:联通 1:移动 2:电信)');
|
|
$table->timestamp('activate_at')->nullable()->comment('激活时间');
|
|
$table->timestamp('virtual_activate_at')->nullable()->comment('虚拟激活时间');
|
|
$table->tinyInteger('type')->unsigned()->default(0)->comment('类型(0:真实卡 1:虚拟卡)');
|
|
$table->timestamps();
|
|
|
|
$table->primary('sim');
|
|
$table->comment('卡基础信息表');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('cards');
|
|
}
|
|
}
|