osb/database/migrations/2022_08_15_171005_qb_account_sync.php

39 lines
943 B
PHP
Raw Normal View History

2022-08-18 13:29:42 +00:00
<?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');
}
};