Run the migrations.

@return void
196994
public function up()
    {
        $driver = Schema::getConnection()->getDriverName();
        // Even though we take care of this scenario in the code,
        // SQL Server does not allow potential cascading loops,
        // so set the default no action and clear out created/modified by another user when deleting a user.

        $onDelete = (('sqlsrv' === $driver) ? 'no action' : 'set null');

        if (!Schema::hasColumn('user_config', 'alt_auth_db_service_id')) {
            Schema::table('user_config', function (Blueprint $t) use ($onDelete){
                $t->integer('alt_auth_db_service_id')->unsigned()->nullable();
                $t->foreign('alt_auth_db_service_id')->references('id')->on('service')->onDelete($onDelete);
                $t->string('alt_auth_table')->nullable();
                $t->string('alt_auth_username_field')->nullable();
                $t->string('alt_auth_password_field')->nullable();
                $t->string('alt_auth_email_field')->nullable();
                $t->string('alt_auth_other_fields')->nullable();
                $t->string('alt_auth_filter')->nullable();
            });
        }
    }
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();
        });
    }
267170
public function up()
    {
        Schema::create('like_counter', function (Blueprint $table) {
            $table->increments('id');
            $table->morphs('likeable');
            $table->enum('type_id', [
                'like',
                'dislike',
            ])->default('like');
            $table->integer('count')->unsigned()->default(0);

            $table->unique([
                'likeable_id',
                'likeable_type',
                'type_id',
            ], 'like_counter_unique');
        });
    }
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']);
        });
    }
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';
        });
    }
759267
public function up()
    {
        $this->schema->create('password_resets', function (Blueprint $table) {
            $table->string('email')->index();
            $table->string('token')->index();
            $table->timestamp('created_at')->nullable();
        });
    }
678435
public function up()
    {
        $this->createSchema(function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('name')->index();
            $table->timestamp('created_at')->index();
            $table->timestamp('updated_at')->index();
        });
    }
733159
public function up()
    {
        Schema::create('articles', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('nickname',50);
            $table->string('scope',50);
            $table->string('lang',10);
            $table->longtext('content');
            $table->boolean('activated')->default(0);
            $table->integer('user_id')->unsigned()->nullable();
            $table->timestamps();
            $table->unique(array('nickname','lang','scope'));
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }
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');
        });
    }
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();
        });
    }
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();
        });
    }
1163583
public function up()
    {
        // --------------------------------
        // Table: users
        // --------------------------------
        Schema::dropIfExists('users');
        Schema::create('users', function (Blueprint $table) {
            $table->uuid('id');
            $table->string('email')->unique();
            $table->string('name');
            $table->string('password');
            $table->rememberToken();
            $table->string('role');
            $table->uuid('selected_context_id')->nullable();
            $table->string('selected_context_type')->nullable();
            $table->string('status');
            // --------------------------------
            // Timestamps
            // --------------------------------
            $table->timestamps();
            $table->softDeletes();
            // --------------------------------
            // Indexes
            // --------------------------------
            $table->primary('id');
        });
    }
603486
public function up()
	{
		Schema::create('terms', function(Blueprint $table)
		{
			$table->bigInteger('id', true)->unsigned();
			$table->bigInteger('parent_id')->unsigned()->default(0)->index('parent_id');
			$table->string('title', 80)->default('');
			$table->string('slug', 80)->default('')->index('slug');
			$table->string('taxonomy', 32)->default('')->index('taxonomy');
			$table->smallInteger('order')->unsigned()->default(99)->index('order');
			$table->timestamps();
		});
	}
539890
public function up()
    {
        Schema::table('comments', function ($table) {
            $table->integer('version')->unsigned()->default(1);
        });

        foreach (CommentProvider::all() as $comment) {
            $comment->update(array('version' => 1));
        }
    }
1103347
public function up()
    {
        Schema::create('phpdebugbar', function (Blueprint $table) {
                $table->string('id');
                $table->longText('data');
                $table->string('meta_utime');
                $table->dateTime('meta_datetime');
                $table->string('meta_uri');
                $table->string('meta_ip');
                $table->string('meta_method');

                $table->primary('id');
                $table->index('meta_utime');
                $table->index('meta_datetime');
                $table->index('meta_uri');
                $table->index('meta_ip');
                $table->index('meta_method');
            });
    }
113294
public function up()
    {
        Schema::create($this->table_menus, function(Blueprint $table) {
            $table->increments('id');
            $table->string('name')->index();
            $table->string('permission')->nullable()->index();
            $table->string('title');
            $table->string('description')->nullable();
            $table->string('route')->nullable();
            $table->string('icon')->nullable();
            $table->boolean('is_active')->default(1);
            $table->boolean('is_protected')->default(0);
            NestedSet::columns($table);
            $table->timestamps();


        });
    }
1164700
public function up()
    {
        Schema::create('did_tag', function (Blueprint $table) {
            $table->uuid('did_id')->index();
            $table->uuid('tag_id')->index();
            $table->timestamps();

            $table->foreign('did_id')->references('id')->on('dids');
            $table->foreign('tag_id')->references('id')->on('tags');
        });
    }