<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateAbServiceMemoTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_service_memo', function(Blueprint $table)
		{
			$table->bigInteger('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->bigInteger('date_orig')->nullable();
			$table->bigInteger('service_id')->default(0);
			$table->bigInteger('account_id')->nullable();
			$table->string('type', 32)->nullable();
			$table->binary('memo', 65535)->nullable();
			$table->primary(['id','site_id','service_id']);
			$table->index(['service_id','site_id']);
			$table->index(['account_id','site_id']);
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('ab_service_memo');
	}

}
