osb/database/migrations/2018_03_11_141103_create_quick_books_tokens_table.php
2019-06-12 16:25:15 +10:00

44 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateQuickBooksTokensTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('quickbooks_tokens', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedBigInteger('realm_id');
$table->longtext('access_token');
$table->datetime('access_token_expires_at');
$table->string('refresh_token');
$table->datetime('refresh_token_expires_at');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('quickbooks_token');
}
}