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

42 lines
999 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbInvoiceItemDiscountTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_invoice_item_discount', function(Blueprint $table)
{
$table->integer('id')->nullable();
$table->integer('site_id')->nullable();
$table->bigInteger('date_orig')->nullable()->index('dates');
$table->bigInteger('invoice_id')->nullable();
$table->bigInteger('account_id')->nullable()->index('accounts');
$table->bigInteger('invoice_item_id')->nullable();
$table->string('discount', 64)->nullable()->index('discounts');
$table->float('amount', 10, 0)->nullable();
$table->unique(['site_id','id'], 'IDS');
$table->index(['invoice_id','invoice_item_id'], 'invoice_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_invoice_item_discount');
}
}