34 lines
709 B
PHP
34 lines
709 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class CreateApiTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('api', function (Blueprint $table) {
|
||
|
$table->increments('id')->unsigned();
|
||
|
$table->integer('user_id')->nullable()->unsigned();
|
||
|
$table->char('key', 36)->unique();
|
||
|
$table->json('allowed_ips')->nullable();
|
||
|
$table->index('key');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::drop('api');
|
||
|
}
|
||
|
}
|