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

43 lines
981 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbPaymentItemTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_payment_item', function(Blueprint $table)
{
$table->bigInteger('id')->default(0);
$table->integer('site_id')->default(0);
$table->bigInteger('date_orig')->nullable();
$table->bigInteger('date_last')->nullable();
$table->bigInteger('payment_id')->default(0);
$table->bigInteger('invoice_id')->nullable();
$table->float('alloc_amt', 10, 0)->nullable();
$table->primary(['id','payment_id','site_id']);
$table->unique(['id','site_id'], 'UNIQUE');
$table->index(['payment_id','site_id'], 'fk_pi_pay_idx');
$table->index(['invoice_id','site_id'], 'fk_pi_inv_idx');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_payment_item');
}
}