Run the migrations.

@return void
196559
public function up()
    {
        $admin  = Role::admin();
        $member = Role::member();
        $acl    = ACL::make('orchestra/story');

        $acl->roles()->attach([$member->name, $admin->name]);
        $acl->actions()->attach([
            'Create Post', 'Update Post', 'Delete Post', 'Manage Post',
            'Create Page', 'Update Page', 'Delete Page', 'Manage Page',
        ]);

        $acl->allow($member->name, [
            'Create Post', 'Update Post', 'Delete Post',
            'Create Page', 'Update Page', 'Delete Page',
        ]);

        $acl->allow($admin->name, [
            'Create Post', 'Update Post', 'Delete Post', 'Manage Post',
            'Create Page', 'Update Page', 'Delete Page', 'Manage Page',
        ]);
    }
363552
public function up()
    {
        Schema::create('user_permissions', function (Blueprint $table) {
			$table->char("user_id", 32)->nullable();
			$table->char("permission_id", 32)->nullable();
            $table->timestamps();
        });
    }
311817
public function up()
    {
        Schema::create('users_roles', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id');
            $table->integer('role_id');
            $table->tinyInteger('is_active')->default(1)->comment('1 = Active, 2 = Inactive');
            $table->timestamps();
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
        });
    }
101127
public function up()
    {
        Schema::create(self::table(), function (Blueprint $table) {
            $table->increments('id');
            $table->string('log_schema');
            $table->string('log_table');
            $table->enum('log_type',[self::TYPE_INSERT,self::TYPE_UPDATE,self::TYPE_DELETE]);
            $table->text('last_value')->nullable();
            $table->timestamp('log_at');
            $table->softDeletes();
        });
    }
1016486
public function up()
	{
		Schema::create('lang', function(Blueprint $table)
		{
			$table->boolean('id')->unique('id');
			$table->string('sname', 5)->nullable()->index('sname');
			$table->string('name', 100)->nullable();
			$table->integer('sort')->nullable()->index('sort');
			$table->boolean('primary')->nullable()->default(0)->index('primary_2');
			$table->boolean('active')->nullable()->default(1)->index('active');
			$table->boolean('active_front')->default(0);
			$table->string('image')->nullable();
		});
	}
489838
public function up()
    {
        Schema::table('categories', function(Blueprint $table)
        {
            $table->string('slug')->nullable()->index();
        });

        Schema::table('articles', function(Blueprint $table)
        {
            $table->string('slug')->nullable()->index();
        });

        Category::all()->each->touch();
    }
962537
public function up()
    {
        Schema::create('changes', function ($table) {
            $table->engine = 'InnoDB';
            $table->increments('id');

            $table->string('model');
            $table->string('key');
            $table->string('action');
            $table->string('title')->nullable();
            $table->longText('changed')->nullable();

            $table->integer('admin_id')->unsigned();
            $table->longText('meta')->nullable();
            $table->boolean('deleted')->nullable();
            $table->timestamps();

            $table->index(['model', 'key']);
            $table->index(['key', 'model']);
            $table->index(['action', 'created_at']);
            $table->index(['created_at', 'action']);
            $table->index(['deleted', 'created_at']);
            $table->foreign('admin_id')->references('id')->on('admins')->onUpdate('cascade')->onDelete('cascade');
        });
    }
409171
public function up()
    {
        Schema::table('changes', function (Blueprint $table) {
            $table->integer('admin_id')->unsigned()->nullable()->change();
        });
        Schema::table('changes', function (Blueprint $table) {
            $table->dropForeign(['admin_id']);
        });
        Schema::table('changes', function (Blueprint $table) {
            $table->foreign('admin_id')
                ->references('id')->on('admins')
                ->onUpdate('cascade')
                ->onDelete('set null');
        });
    }
401337
public function up()
	{
		Schema::connection(config('settings.db_connection'))->create(config('settings.db_table'), function (Blueprint $table)
		{
			$table->string('setting_key')->index()->unique();
			$table->binary('setting_value')->nullable();
		});
	}
203907
public function up()
    {
        Schema::create('user_groups', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id');
            $table->unsignedInteger('group_id');

            $table->foreign('user_id')->references('id')->on(config('membership.users.table'));
            $table->foreign('group_id')->references('id')->on('groups');

            $table->unique(['user_id', 'group_id']);
            $table->index(['user_id', 'group_id']);
        });
    }
1353512
public function up()
    {
        Schema::create('scaffoldinterfaces', function (Blueprint $table) {
            $table->increments('id');
            $table->String('package');
            $table->String('migration');
            $table->String('model');
            $table->String('controller');
            $table->String('views');
            $table->String('tablename');
            $table->timestamps();
        });
    }
1260883
public function up()
    {
        Schema::create('permission_user', function (Blueprint $table) {
            $table->unsignedInteger('permission_id');
            $table->unsignedInteger('user_id');
            $table->string('user_type');

            $table->foreign('permission_id')->references('id')->on('permissions')
                ->onUpdate('cascade')->onDelete('cascade');

            $table->primary(['user_id', 'permission_id', 'user_type']);
        });
    }
374202
public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('name', 64)->change();
            $table->string('email', 64)->nullable()->change();
            $table->string('password', 64)->nullable()->change();
            $table->char('locale', 5);
            $table->char('currency', 3);
            $table->integer('joined')->unsigned();
            $table->integer('last_login')->unsigned();
            $table->tinyInteger('notifications')->unsigned();

            $table->renameColumn('id', 'user_id');
            $table->renameColumn('name', 'username');
            $table->dropColumn('created_at');
            $table->dropColumn('updated_at');
        });

        Schema::create('categories', function (Blueprint $table) {
            $table->mediumInteger('category_id', true)->unsigned();
            $table->mediumInteger('parent_category_id')->nullable()->unsigned();
            $table->string('name', 128);
            $table->string('slug', 32);
            $table->tinyInteger('sort')->unsigned();

            $table->foreign('parent_category_id')->references('category_id')->on('categories');
            $table->unique(['parent_category_id', 'slug']);
        });

        Schema::create('item_conditions', function (Blueprint $table) {
            $table->mediumInteger('item_condition_id', true)->unsigned();
            $table->string('name', 64);
            $table->tinyInteger('sort')->unsigned();
        });

        Schema::create('listing_durations', function (Blueprint $table) {
            $table->mediumInteger('listing_duration_id', true)->unsigned();
            $table->integer('duration')->unsigned();
            $table->tinyInteger('sort')->unsigned();
        });

        Schema::create('items', function (Blueprint $table) {
            $table->integer('item_id')->unsigned();
            $table->string('name', 128);
            $table->mediumInteger('item_condition_id')->unsigned();
            $table->integer('user_id')->unsigned();
            $table->text('description');
            $table->boolean('auction');
            $table->integer('quantity')->unsigned();
            $table->decimal('start_price', 8, 2)->nullable()->unsigned();
            $table->decimal('reserve_price', 8, 2)->nullable()->unsigned();
            $table->decimal('bidding_price', 8, 2)->nullable()->unsigned();
            $table->decimal('fixed_price', 8, 2)->nullable()->unsigned();
            $table->decimal('commission', 5, 2)->unsigned();
            $table->integer('winning_bid_id')->nullable()->unsigned();
            $table->integer('duration')->unsigned();
            $table->integer('start_date')->unsigned();
            $table->integer('end_date')->unsigned();
            $table->integer('created')->unsigned();
            $table->string('collection_location')->nullable();
            $table->boolean('payment_other');
            $table->tinyInteger('returns_period')->nullable()->unsigned();

            $table->primary('item_id');
            $table->foreign('user_id')->references('user_id')->on('users');
            $table->foreign('item_condition_id')->references('item_condition_id')->on('item_conditions');
        });

        Schema::create('item_categories', function (Blueprint $table) {
            $table->integer('item_id')->unsigned();
            $table->mediumInteger('category_id')->unsigned();

            $table->primary(['item_id', 'category_id']);
            $table->foreign('item_id')->references('item_id')->on('items');
            $table->foreign('category_id')->references('category_id')->on('categories');
        });

        Schema::create('delivery_options', function (Blueprint $table) {
            $table->integer('delivery_option_id', true)->unsigned();
            $table->integer('item_id')->unsigned();
            $table->string('name', 64);
            $table->float('price', 5, 2)->unsigned();
            $table->tinyInteger('min_arrival_time')->unsigned();
            $table->tinyInteger('max_arrival_time')->unsigned();

            $table->foreign('item_id')->references('item_id')->on('items');
        });

        Schema::create('failed_jobs', function (Blueprint $table) {
            $table->increments('failed_job_id');
            $table->text('connection');
            $table->text('queue');
            $table->text('payload');
            $table->timestamp('failed_at');
        });

        Schema::create('watched_items', function (Blueprint $table) {
            $table->integer('item_id')->unsigned();
            $table->integer('user_id')->unsigned();
            $table->integer('added')->unsigned();

            $table->primary(['item_id', 'user_id']);
            $table->foreign('item_id')->references('item_id')->on('items');
            $table->foreign('user_id')->references('user_id')->on('users');
        });

        $conditions = [
            'New',
            'Used',
            'Refurbished',
            'Faulty / Spares',
        ];

        foreach ($conditions as $condition) {
            $item_condition = new ItemCondition();

            $item_condition->name = $condition;

            $item_condition->save();
        }

        $durations = [
            86400,
            86400 * 3,
            86400 * 7,
            86400 * 14,
            86400 * 28,
        ];

        foreach ($durations as $duration) {
            $listing_duration = new ListingDuration();

            $listing_duration->duration = $duration;

            $listing_duration->save();
        }
    }
578981
public function up()
    {
        Schema::create('tags', function (Blueprint $table) {
            $table->uuid('id')->primary('id');
            $table->uuid('user_id')->index();
            $table->string('text', 64)->index('text');
            $table->timestamps();

            $table->unique(['user_id', 'text']);

            $table->foreign('user_id')->references('id')->on('users');
        });

    }
888822
public function up()
    {
    	if (Schema::hasTable('users')) {

    		Schema::table('users', function (Blueprint $table) {
	            
	            if (!Schema::hasColumn('users', 'is_admin')) {

	            	$table->tinyInteger('is_admin')->default(0)->comment('1: admin, 0: not is admin');
	            }

	            if (!Schema::hasColumn('users', 'name')) {
	            	$table->string('name');
	            }
	            
	            if (!Schema::hasColumn('users', 'email')) {
	            	$table->string('email')->unique();
	            }

	            if (!Schema::hasColumn('users', 'password')) {
	            	$table->string('password');
	            }

	            if (!Schema::hasColumn('users', 'remember_token')) {
	            	$table->rememberToken();
	            }


	        });
    	}

    	else {

    		Schema::create('users', function (Blueprint $table) {
	            $table->increments('id');
	            $table->string('name');
	            $table->string('email')->unique();
	            $table->string('password');
	            $table->tinyInteger('is_admin')->default(0)->comment('1: admin, 0: not is admin');
	            $table->rememberToken();
	            $table->timestamps();
	        });
    	}
        
    }
191146
public function up()
    {
        $this->create('migrations', function ($table) {
            // Place table rows here
            $table->increments('id');
            $table->string('migration');
            $table->integer('migrated');
            $table->timestamps();
        });
    }
974226
public function up()
	{
		Schema::table('users', function(Blueprint $table)
		{
			$table->string('lastname',255);
			$table->string('surname',255);
			$table->boolean('active')->default(false);
		});
	}