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

44 lines
1005 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateAbAccountBillingTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ab_account_billing', function(Blueprint $table)
{
$table->integer('id');
$table->integer('site_id');
$table->bigInteger('account_id')->nullable();
$table->integer('checkout_id');
$table->bigInteger('service_id')->nullable();
$table->binary('checkout_data', 65535)->nullable();
$table->float('checkout_amount', 10, 0)->nullable();
$table->string('notes', 128)->nullable();
$table->primary(['id','site_id','checkout_id']);
$table->unique(['site_id','service_id'], 'UNIQUE');
$table->index(['account_id','site_id'], 'fk_ab_a');
$table->index(['service_id','site_id'], 'fk_ab_s');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('ab_account_billing');
}
}