Run the migrations.

@return void
543144
public function up()
    {
        Schema::table('asset_versions', function (Blueprint $table) {
            $table->float('aspect_ratio', 8, 3)
                ->nullable()
                ->default(null);
        });

        $versions = AssetVersion::all();

        foreach ($versions as $version) {
            $path = storage_path().'/boomcms/assets/'.$version->id;

            if (is_readable($path)) {
                $info = FileInfo::create(new File($path));

                $version->fill([
                    'aspect_ratio' => $info->getAspectRatio(),
                    'width'        => $info->getWidth(),
                    'height'       => $info->getHeight(),
                    'metadata'     => $info->getMetadata(),
                ])->save();
            }
        }
    }
1108569
public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('commenter_id');
            $table->morphs('commentable');
            $table->text('comment');
            $table->unsignedBigInteger('child_id')->nullable();
            $table->foreign('child_id')->references('id')->on('comments')->onDelete('cascade');
            $table->timestamps();
        });
    }
594197
public function up()
    {
        Schema::table('user_addresses', function (Blueprint $table) {
            $table->string('uid', 32)->unique();
            $table->string('phone_work')->nullable();
            $table->string('phone_home')->nullable();
            $table->string('phone_mobile')->nullable();
            $table->text('other_informations')->nullable();

            DB::statement('ALTER TABLE `user_addresses` MODIFY `address2` VARCHAR(255) NULL;');
        });

        Schema::table('order_addresses', function (Blueprint $table) {
            $table->string('uid', 32)->unique();
            $table->string('phone_work')->nullable();
            $table->string('phone_home')->nullable();
            $table->string('phone_mobile')->nullable();
            $table->text('other_informations')->nullable();

            DB::statement('ALTER TABLE `user_addresses` MODIFY `address2` VARCHAR(255) NULL;');
        });

        Schema::table('products', function (Blueprint $table) {
            $table->softDeletes();
        });
    }
451233
public function up()
    {
        if ( ! Schema::hasTable('provinces')) {
            Schema::create('provinces', function(Blueprint $table) {
                $table->increments('id');
                $table->string('province', 50);

                $table->engine = 'InnoDB';
            });
        }

        if ( ! Schema::hasTable('counties')) {
            Schema::create('counties', function(Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('province_id');
                $table->foreign('province_id')->references('id')->on('provinces')->onDelete('cascade');
                $table->string('county', 75);

                $table->engine = 'InnoDB';
            });
        }

        if ( ! Schema::hasTable('districts')) {
            Schema::create('districts', function(Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('county_id');
                $table->foreign('county_id')->references('id')->on('counties')->onDelete('cascade');
                $table->string('district', 75);

                $table->engine = 'InnoDB';
            });
        }

        if ( ! Schema::hasTable('neighborhoods')) {
            Schema::create('neighborhoods', function(Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('district_id');
                $table->foreign('district_id')->references('id')->on('districts')->onDelete('cascade');
                $table->string('neighborhood', 150);

                $table->engine = 'InnoDB';
            });
        }

        if ( ! Schema::hasTable('postal_codes')) {
            Schema::create('postal_codes', function(Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('neighborhood_id');
                $table->foreign('neighborhood_id')->references('id')->on('neighborhoods')->onDelete('cascade');
                $table->char('postal_code', 6);

                $table->engine = 'InnoDB';
            });
        }
    }
769996
public function up()
    {
        Schema::create('authentication_log', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->morphs('authenticatable');
            $table->string('ip_address', 45)->nullable();
            $table->text('user_agent')->nullable();
            $table->timestamp('login_at')->nullable();
            $table->timestamp('logout_at')->nullable();
        });
    }
131245
public function up()
    {
        Schema::create('like', function (Blueprint $table) {
            $table->increments('id');
            $table->morphs('likeable');
            $table->integer('user_id')->unsigned()->index();
            $table->enum('type_id', [
                'like',
                'dislike',
            ])->default('like');
            $table->timestamp('created_at')->nullable();

            $table->unique([
                'likeable_id',
                'likeable_type',
                'user_id',
            ], 'like_user_unique');

            // $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }
1178543
public function up()
    {
        Schema::create(
            'contents',
            function (Blueprint $table) {
                $table->increments('id');
                $table->timestamps();
            }
        );

        Schema::create(
            'revisions',
            function (Blueprint $table) {
                $table->increments('id');
                $table->unsignedInteger('language_id');
                $table->unsignedInteger('content_id');
                $table->timestamps();

                $table->foreign('language_id')->references('id')->on('languages');
                $table->foreign('content_id')->references('id')->on('contents');
            }
        );

        Schema::create(
            'field_string',
            function (Blueprint $table) {
                $this->fieldTableFields($table);
                $table->string('value');
            }
        );

        Schema::create(
            'field_text',
            function (Blueprint $table) {
                $this->fieldTableFields($table);
                $table->text('value');
            }
        );

        Schema::create(
            'field_date',
            function (Blueprint $table) {
                $this->fieldTableFields($table);
                $table->date('value');
            }
        );

        Schema::create(
            'field_datetime',
            function (Blueprint $table) {
                $this->fieldTableFields($table);
                $table->datetime('value');
            }
        );

        Schema::create(
            'field_entity',
            function (Blueprint $table) {
                $this->fieldTableFields($table);
                $table->unsignedInteger('value');
                $table->foreign('value')->references('id')->on('contents');
            }
        );
    }
271364
public function up()
    {

        Schema::create('User', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 25)->nullable()->unique();
            $table->string('password', 60)->nullable();
            $table->string('first_name', 25);
            $table->string('last_name', 25);
            $table->string('email')->unique();
            $table->text('description')->nullable();
            $table->timestamp('birthday')->nullable();
            $table->string('pic')->nullable();
            $table->integer('gender');
            $table->tinyInteger('status');
            $table->string('ip', 15);
            $table->tinyInteger('staff');
            $table->tinyInteger('force_new_password');
            $table->timestamp('last_login')->nullable();
            $table->text('permissions')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
            $table->creation();
        });

        Schema::table('User', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Visits', function (Blueprint $table) {
            $table->increments('id');
            $table->string('url')->nullable();
            $table->string('ip', 15)->nullable();
            $table->string('browser')->nullable();
            $table->tinyInteger('checked');

            $table->string('isoCode')->nullable();
            $table->string('country')->nullable();
            $table->string('city')->nullable();
            $table->string('state')->nullable();
            $table->string('postal_code')->nullable();
            $table->string('lat')->nullable();
            $table->string('lon')->nullable();
            $table->string('timezone')->nullable();
            $table->string('continent')->nullable();
            $table->timestamps();
        });

        Schema::create('Logs', function (Blueprint $table) {
            $table->increments('id');
            $table->text('log');
            $table->integer('target')->nullable();
            $table->string('ip', 15)->nullable();
            $table->timestamps();
            $table->creation();
        });

        Schema::table('Logs', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Settings', function (Blueprint $table) {
            $table->increments('id');
            $table->string('friendly_name', 25);
            $table->string('name', 25);
            $table->string('value', 150)->nullable();
            $table->string('description', 250)->nullable();
            $table->timestamps();
            $table->creation();
        });

        Schema::table('Settings', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Group', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 25);
            $table->string('description', 250)->nullable();
            $table->string('slug', 250);
            $table->text('permissions')->nullable();

            $table->timestamps();
            $table->softDeletes();
            $table->creation();

            $table->unique('slug');
        });

        Schema::table('Group', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('Group_User', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user')->unsigned();
            $table->integer('group')->unsigned();

            $table->timestamps();
            $table->softDeletes();
            $table->creation();

            $table->foreign('user')->references('id')->on('User');
            $table->foreign('group')->references('id')->on('Group');
        });

        Schema::table('Group_User', function (Blueprint $table) {
            $table->creationRelation();
        });

        Schema::create('ActivityFeed', function (Blueprint $table) {
            $table->increments('id');
            $table->string('added_by', 150);
            $table->text('activity');
            $table->string('icon', 100);
            $table->string('link', 250)->nullable();
            $table->text('permissions')->nullable();

            $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();
        });
    }
682410
public function up()
    {
        Schema::create('objects', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->integer('image_id')->unsigned()->nullable();
            $table->json('status');
            $table->json('title');
            $table->json('slug');
            $table->json('summary');
            $table->json('body');
            $table->timestamps();
        });
    }
804004
public function up()
    {

        Schema::table('group_role', function (Blueprint $table) {

            $table->boolean('not')->after('group_id')->default(false);
        });

        Schema::table('permission_role', function (Blueprint $table) {

            $table->boolean('not')->after('role_id')->default(false);
        });

        Schema::table('affiliation_user', function (Blueprint $table) {

            $table->boolean('not')->after('affiliation_id')->default(false);
        });

        Schema::table('affiliation_role', function (Blueprint $table) {

            $table->boolean('not')->after('affiliation_id')->default(false);
        });
    }
488580
public function up()
    {
        Schema::create('user_action_timestamps', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->timestamp('activated_at')->nullable();
            $table->timestamp('invited_at')->nullable();
            $table->timestamp('blocked_at')->nullable();
            $table->timestamp('password_updated_at')->nullable();
            $table->softDeletes();

            $table->foreign('user_id')
                ->references('id')
                ->on('users')
                ->onDelete('cascade');
        });
    }
1090524
public function up()
    {
        Schema::table('users', function ($table) {
            $table->integer('role_id')->unsigned()->nullable()->after('id');
            $table->foreign('role_id')->references('id')->on('roles')->onDelete('set null')->onUpdate('cascade');
        });
    }
1183544
public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->enum('type', array_values(UserType::toArray()))->default(UserType::__default);
            $table->boolean('is_active')->default(true);
            $table->dateTime('last_login_at')->nullable();
            $table->integer('login_count')->unsigned()->nullable()->default(0);
            $table->softDeletes();
        });
    }
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();
    }
719096
public function up()
	{
		Schema::create('posts', function($table)
		{
			$table->increments('id');
			$table->string('title');
			$table->string('slug');
			$table->text('content');
			$table->string('image')->default('');
			$table->string('type')->default('post');
			$table->timestamp('publish_date');
			$table->tinyInteger('active')->default(0);
			$table->timestamps();
		});
	}
107134
public function up()
    {
        Schema::create(Models::table('abilities'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('title')->nullable();
            $table->integer('entity_id')->unsigned()->nullable();
            $table->string('entity_type')->nullable();
            $table->boolean('only_owned')->default(false);
            $table->json('options')->nullable();
            $table->integer('scope')->nullable()->index();
            $table->timestamps();
        });

        Schema::create(Models::table('roles'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('title')->nullable();
            $table->integer('level')->unsigned()->nullable();
            $table->integer('scope')->nullable()->index();
            $table->timestamps();

            $table->unique(
                ['name', 'scope'],
                'roles_name_unique'
            );
        });

        Schema::create(Models::table('assigned_roles'), function (Blueprint $table) {
            $table->increments('id');
            $table->integer('role_id')->unsigned()->index();
            $table->integer('entity_id')->unsigned();
            $table->string('entity_type');
            $table->integer('restricted_to_id')->unsigned()->nullable();
            $table->string('restricted_to_type')->nullable();
            $table->integer('scope')->nullable()->index();

            $table->index(
                ['entity_id', 'entity_type', 'scope'],
                'assigned_roles_entity_index'
            );

            $table->foreign('role_id')
                  ->references('id')->on(Models::table('roles'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });

        Schema::create(Models::table('permissions'), function (Blueprint $table) {
            $table->increments('id');
            $table->integer('ability_id')->unsigned()->index();
            $table->integer('entity_id')->unsigned()->nullable();
            $table->string('entity_type')->nullable();
            $table->boolean('forbidden')->default(false);
            $table->integer('scope')->nullable()->index();

            $table->index(
                ['entity_id', 'entity_type', 'scope'],
                'permissions_entity_index'
            );

            $table->foreign('ability_id')
                  ->references('id')->on(Models::table('abilities'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });
    }