<?php

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

class CreateAbTaskTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_task', function(Blueprint $table)
		{
			$table->bigInteger('id')->default(0);
			$table->integer('site_id')->default(0)->index();
			$table->bigInteger('date_orig')->nullable();
			$table->bigInteger('date_last')->nullable();
			$table->bigInteger('date_run')->nullable();
			$table->integer('active')->nullable();
			$table->string('name', 32)->nullable();
			$table->string('description')->nullable();
			$table->boolean('log')->nullable();
			$table->integer('type')->nullable();
			$table->string('command', 128)->nullable();
			$table->string('int_min', 32)->nullable();
			$table->string('int_hour', 32)->nullable();
			$table->string('int_month', 32)->nullable();
			$table->string('int_month_day', 32)->nullable();
			$table->string('int_week_day', 32)->nullable();
			$table->boolean('running')->nullable();
			$table->string('running_host', 4)->nullable();
			$table->primary(['id','site_id']);
		});
	}


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

}
