<?php

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

class CreateAbEmailSetupTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_email_setup', function(Blueprint $table)
		{
			$table->integer('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->bigInteger('account_id')->default(0);
			$table->string('name', 128)->nullable();
			$table->text('notes')->nullable();
			$table->boolean('type')->nullable();
			$table->string('from_name', 128)->nullable();
			$table->string('from_email', 128)->nullable();
			$table->text('cc_list')->nullable();
			$table->text('bcc_list')->nullable();
			$table->string('server', 128)->nullable();
			$table->string('username', 128)->nullable();
			$table->string('password', 128)->nullable();
			$table->string('piping', 4)->nullable();
			$table->string('piping_host', 128)->nullable();
			$table->string('piping_username', 128)->nullable();
			$table->string('piping_password', 128)->nullable();
			$table->string('piping_action', 4)->nullable();
			$table->boolean('queue')->nullable();
			$table->primary(['id','site_id','account_id']);
			$table->index(['account_id','site_id']);
		});
	}


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

}
