<?php

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

class CreateTableGroupPermissions extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('group_permissions', function(Blueprint $table)
		{
			$table->unsignedBigInteger('group_id');
			$table->unsignedBigInteger('permission_id');
			$table->timestamps();

			// Composite Primary KEY
			$table->primary(array('group_id', 'permission_id'));
		});
	}

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

}
