<?php

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

class CreateAbCartTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_cart', function(Blueprint $table)
		{
			$table->integer('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->bigInteger('date_orig')->nullable();
			$table->string('session_id', 32)->default('');
			$table->integer('quantity')->nullable();
			$table->integer('module_id')->default(0);
			$table->integer('module_item')->default(0);
			$table->text('module_data', 65535)->nullable();
			$table->primary(['id','site_id']);
			$table->index(['module_id','site_id']);
		});
	}


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

}
