osb/database/migrations/2017_06_18_104531_create_ab_account_oauth_table.php
2018-06-18 21:18:34 +10:00

44 lines
991 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbAccountOauthTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_account_oauth', function(Blueprint $table)
{
$table->bigInteger('id');
$table->integer('site_id');
$table->bigInteger('date_orig')->nullable();
$table->bigInteger('date_last')->nullable();
$table->bigInteger('account_id');
$table->integer('oauth_id');
$table->string('userid', 128);
$table->binary('oauth_data', 65535)->nullable();
$table->primary(['id','site_id','account_id','oauth_id']);
$table->unique(['site_id','account_id','oauth_id'], 'UNIQUE');
$table->index(['oauth_id','site_id'], 'fk_ao_o_idx');
$table->index(['account_id','site_id'], 'fk_ao_a_idx');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_account_oauth');
}
}