<?php

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

class CreateAbModuleMethodTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_module_method', function(Blueprint $table)
		{
			$table->integer('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->integer('module_id')->default(0);
			$table->string('name', 64)->nullable()->default('');
			$table->string('notes', 128)->nullable();
			$table->string('menu_display', 32)->nullable();
			$table->primary(['id','site_id','module_id']);
			$table->unique(['id','site_id']);
			$table->unique(['site_id','module_id','name']);
			$table->index(['module_id','site_id']);
		});
	}


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

}
