<?php

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

class FixEveryTableForRubric extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('rubrics', function (Blueprint $table) {
			$table->integer('num_scales')->unsigned();
			$table->integer('max_score')->unsigned();
		});
		Schema::table('templates', function (Blueprint $table) {
			$table->integer('num_scales')->unsigned();
			$table->integer('max_score')->unsigned();
		});
		Schema::table('scales', function (Blueprint $table) {
			$table->dropColumn('title');
			$table->dropColumn('position');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('rubrics', function (Blueprint $table) {
			$table->dropColumn('num_scales');
			$table->dropColumn('max_score');
		});
		Schema::table('templates', function (Blueprint $table) {
			$table->dropColumn('num_scales');
			$table->dropColumn('max_score');
		});
		Schema::table('scales', function (Blueprint $table) {
			$table->text('title');
		});
	}
}
