osb/database/migrations/2023_05_13_142113_accounting_payment.php

39 lines
939 B
PHP
Raw Normal View History

2023-05-13 11:20:56 +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('payment__provider', function (Blueprint $table) {
$table->timestamps();
$table->integer('payment_id')->unsigned();
$table->integer('provider_oauth_id')->unsigned();
$table->integer('site_id')->unsigned();
$table->string('ref');
$table->integer('synctoken');
$table->foreign(['payment_id','site_id'])->references(['id','site_id'])->on('payments');
$table->foreign(['provider_oauth_id','site_id'])->references(['id','site_id'])->on('provider_oauth');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment__provider');
}
};