vd/database/migrations/2018_12_24_164218_create_cards_table.php
2018-12-25 10:51:10 +08:00

47 lines
1.5 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('activated_at')->nullable()->comment('激活时间');
$table->timestamp('virtual_activated_at')->nullable()->comment('虚拟激活时间');
$table->tinyInteger('type')->unsigned()->default(0)->comment('类型(0:真实卡 1:虚拟卡 2:未知卡)');
$table->timestamp('cancelled_at')->nullable()->comment('注销时间');
$table->timestamps();
$table->primary('sim');
$table->comment('卡基础信息表');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cards');
}
}