39 lines
943 B
PHP
39 lines
943 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('account_provider', function (Blueprint $table) {
|
||
|
$table->timestamps();
|
||
|
$table->integer('account_id')->unsigned();
|
||
|
$table->integer('provider_oauth_id')->unsigned();
|
||
|
$table->integer('site_id')->unsigned();
|
||
|
$table->string('ref');
|
||
|
$table->integer('synctoken');
|
||
|
|
||
|
$table->foreign(['account_id','site_id'])->references(['id','site_id'])->on('accounts');
|
||
|
$table->foreign(['provider_oauth_id','site_id'])->references(['id','site_id'])->on('provider_oauth');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('account_provider');
|
||
|
}
|
||
|
};
|