Run the migrations.

@return void
2340
public function up()
    {
        $this->down();
        Schema::create('tbl_widgets', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('type_id')->unsigned()->index('type_id');
            $table->string('name')->index('name');
            $table->timestamps();
            $table->softDeletes();
        });
        Schema::create('tbl_widget_types', function(Blueprint $table) {
            $table->increments('id');
            $table->string('slug')->index('slug');
            $table->string('name')->index('name');
            $table->string('description', 500)->nullable();
        });
        Schema::create('tbl_widgets_params', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('parent_id')->unsigned()->nullable()->index('parent_id');
            $table->integer('wid')->unsigned()->index('wid');
            $table->integer('uid')->unsigned()->index('uid');
            $table->integer('brand_id')->unsigned()->index('FK_tbl_widgets_params');
            $table->string('resource', 500)->nullable();
            $table->string('name')->index('tbl_widgets_custom_name_unique');
            $table->text('data')->nullable();
        });
        Schema::create('tbl_page_closure', function(Blueprint $table) {
            $table->increments('closure_id');
            $table->integer('ancestor')->unsigned()->index('page_closure_ancestor_foreign');
            $table->integer('descendant')->unsigned()->index('page_closure_descendant_foreign');
            $table->integer('depth')->unsigned();
        });

        Schema::table('tbl_widgets', function(Blueprint $table) {
            $table->foreign('type_id', 'tbl_widgets_ibfk_1')->references('id')->on('tbl_widget_types')->onUpdate('NO ACTION')->onDelete('CASCADE');
        });
        Schema::table('tbl_widgets_params', function(Blueprint $table) {
            $table->foreign('brand_id', 'tbl_widgets_params_ibfk_4')->references('id')->on('tbl_brands')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->foreign('parent_id', 'tbl_widgets_params_ibfk_1')->references('id')->on('tbl_widgets_params')->onUpdate('NO ACTION')->onDelete('SET NULL');
            $table->foreign('wid', 'tbl_widgets_params_ibfk_2')->references('id')->on('tbl_widgets')->onUpdate('NO ACTION')->onDelete('CASCADE');
            $table->foreign('uid', 'tbl_widgets_params_ibfk_3')->references('id')->on('tbl_users')->onUpdate('NO ACTION')->onDelete('CASCADE');
        });
        Schema::table('tbl_page_closure', function(Blueprint $table) {
            $table->foreign('ancestor', 'page_closure_ancestor_foreign')->references('id')->on('tbl_widgets_params')->onUpdate('RESTRICT')->onDelete('CASCADE');
            $table->foreign('descendant', 'page_closure_descendant_foreign')->references('id')->on('tbl_widgets_params')->onUpdate('RESTRICT')->onDelete('CASCADE');
        });
    }
974226
public function up()
	{
		Schema::table('users', function(Blueprint $table)
		{
			$table->string('lastname',255);
			$table->string('surname',255);
			$table->boolean('active')->default(false);
		});
	}
1051884
public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('post_id')->nullable();
            $table->unsignedBigInteger('user_id')->nullable();
            $table->integer('parent_id')->nullable();
            $table->text('content');
            $table->boolean('approved')->nullable();
            $table->timestamps();

            $table->index(['approved', 'post_id']);
            $table->index('post_id');
            $table->index('parent_id');
            $table->foreign('post_id')
                ->references('id')
                ->on('posts')
                ->onUpdate('cascade')
                ->onDelete('cascade');
            $table->foreign('user_id')
                ->references('id')
                ->on('users')
                ->onUpdate('cascade')
                ->onDelete('cascade');
        });
    }
1035303
public function up()
    {
        Schema::table('articles', function (Blueprint $table) {
            $table->time('time')->after('date')->nullable();
        });
        Schema::table('articles', function (Blueprint $table) {
            $table->datetime('datetime')->after('time')->nullable();
        });
    }
626258
public function up()
    {
        $this->schema->create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password')->nullable();
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }
1266999
public function up()
    {
        Schema::table(config('cms.db-prefix', '').'pages', function (Blueprint $table) {
            $table->text('blocks')->nullable();
        });

        Schema::table(config('cms.db-prefix', '').'blogs', function (Blueprint $table) {
            $table->text('blocks')->nullable();
        });

        Schema::table(config('cms.db-prefix', '').'events', function (Blueprint $table) {
            $table->text('blocks')->nullable();
        });
    }
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();
        });
    }
825663
public function up()
    {
        Schema::create(
            'option_categories',
            function (Blueprint $table) {
                $table->string('key');
                $table->timestamps();
                $table->primary('key');
            }
        );

        Schema::create(
            'options',
            function (Blueprint $table) {
                $table->increments('id');
                $table->string('key');
                $table->string('category_key');
                $table->text('value');
                $table->timestamps();
                $table->foreign('category_key')->references('key')->on('option_categories')->onDelete('CASCADE');
                $table->index(['category_key', 'key']);
            }
        );

        // Seed options
        $this->seedOptions();
    }
1308151
public function up()
    {
        Schema::create('users', function (Blueprint $table) {

            $table->increments('id');
            $table->string('name', 100);
            $table->string('email', 100)->unique();
            $table->string('password');
            $table->string('role', 100)->default('user');

            $table->string('avatar', 100)->nullable();
            $table->text('info')->length(500)->nullable();
            $table->string('where_from')->nullable();
            $table->rememberToken();
            $table->string('api_token', 32)->nullable(); // md5(str_random(16));
            $table->ipAddress('last_ip')->nullable();

            $table->index('name');

            $table->timestamps();
            $table->timestamp('logined_at')->nullable();
        });
    }
158776
public function up()
    {
        Schema::table($this->tablename, function (Blueprint $table) {
            $table->dropIndex($this->tablename . '_' . $this->keyColumn . '_index');
            $table->unique($this->keyColumn, 'settings_key_unique');
        });
    }
1069466
public function up()
    {
        Schema::table('users', function ($table) {
            $table->integer('site_id')->unsigned()->nullable()->after('id');
            $table->string('username')->after('email');
            $table->string('avatar')->nullable()->after('password');
            $table->string('background')->nullable()->after('avatar');
            $table->string('jobtitle')->nullable()->after('background');
            $table->text('socials')->nullable()->after('jobtitle');
            $table->text('about')->nullable()->after('socials');
            
            $table->foreign('site_id')
                  ->references('id')->on('sites')
                  ->onDelete('cascade');

        });
    }
819778
public function up()
    {
        Schema::create('authors', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email');
            $table->timestamps();
        });

        Schema::create('books', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->date('published_at')->nullable();
            $table->integer('author_id')->unsigned()->index();
            $table->text('description')->nullable();
            $table->boolean('out_of_print')->default(false);
            $table->timestamps();
        });
    }
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();
	        });
    	}
        
    }
315831
public function up()
    {

        Schema::create('userattitudes_counters', function (Blueprint $table) {
            $table->string('item_type', 32);
            $table->integer('item_id')->unsigned();
            $table->integer('count')->unsigned()->nullable()->default(null);
        });

    }
1108754
public function up()
    {
        Schema::create('scaffoldinterfaces', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->String('package');
            $table->String('migration');
            $table->String('model');
            $table->String('controller');
            $table->String('views');
            $table->String('tablename');
            $table->timestamps();
        });
        Schema::create('relations', function (Blueprint $table) {
            $table->increments('id')->unsigned();
            $table->integer('scaffoldinterface_id')->unsigned();
            $table->String('to');
            $table->String('having');
            $table->foreign('scaffoldinterface_id')->references('id')->on('scaffoldinterfaces')->onDelete('cascade');
            $table->timestamps();
        });
    }
946503
public function up()
	{
		Schema::create('tags', function($table)
		{
			$table->integer('post_id');
			$table->string('tag');
			$table->unique(array('post_id', 'tag'));
		});
	}
1088419
public function up()
    {
        Schema::create('pages', function (Blueprint $table) {
            $table->increments('id');
            $table->string(Entity::getUrlIDField())->unique();
            $table->string(Entity::getStringIdField())->unique();
            $table->string('title');
            $table->string('meta_title');
            $table->string('meta_description');
            $table->string('meta_keywords');
            $table->tinyInteger('status')->default(Entity::STATUS_PUBLISHED);
            $table->timestamps();
        });
    }