<?php

use Illuminate\Database\Migrations\Migration;

class CreateProjectsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('projects', function($table) {
			$table->increments('id');
			$table->integer('user_id');
			$table->string('name');
			$table->softDeletes();
			$table->timestamps();
			$table->engine = 'InnoDB';
		});
		Schema::create('users_projects', function($table) {
			$table->integer('user_id');
			$table->integer('project_id');
			$table->primary(array('user_id', 'project_id'));
			$table->engine = 'InnoDB';
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::drop('projects');
		Schema::drop('users_projects');
	}

}
