Migrate up

@return void
516971
public function up()
    {
        $table = $this->table('users');
        $table->changeColumn('username', 'string', ['null' => true, 'default' => null]);
        $table->update();
    }
421016
public function up()
    {
        Schema::create('hc_users_password_resets', function (Blueprint $table) {
            $table->string('email')->index();
            $table->string('token')->index();
            $table->dateTime('created_at');
        });
    }
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();
        });
    }
992379
public function up()
    {
        Schema::create('queues', function (Blueprint $table) {
            $table->increments('id');
            $table->string('queue', 255)->nullable()->default(null);
            $table->integer('status')->default(0);
            $table->integer('retries')->default(0);
            $table->timestamp('timestamp');
            $table->longText('payload')->nullable();
            $table->timestamps();
        });
    }
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');
        });
    }
208978
public function up()
    {
        Schema::table('fieldables', function (Blueprint $table) {
            $table->integer('position')->unsigned()->nullable()->default('1')->change();
        });
    }
880438
public function up()
	{
		Schema::create('password_reminders', function($t)
		{
			$t->string('email');
			$t->string('token');
			$t->timestamp('created_at');
		});
	}
1332825
public function up()
    {
        $connection = config('admin.database.connection') ?: config('database.default');

        $table = config('admin.extensions.config.table', 'admin_config');

        Schema::connection($connection)->create($table, function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
            $table->string('value');
            $table->text('description')->nullable();
            $table->timestamps();
        });
    }
755140
public function up()
    {
        // Check if the table exists
        if (Schema::hasTable('translations')) {
            if (Schema::hasColumn('translations', 'translatable_type')) {
                $items = DB::select('select * from translations');
                foreach ($items as $item) {
                    // Points to new namespace Redooor\\Redminportal\\App\\Models\\
                    $new_type_array = explode('\\', $item->translatable_type);
                    $last_model = array_pop($new_type_array);
                    $new_type = 'Redooor\\Redminportal\\App\\Models\\' . $last_model;
                    DB::table('translations')->where('id', $item->id)
                        ->update([
                        'translatable_type' => $new_type
                    ]);
                }
            }
        }
    }
533618
public function up()
	{
		Schema::create('item_ratings', function($table)
		{
		    $table->increments('id');
		    $table->integer('item_id');
		    $table->tinyInteger('score')->default('1');
		    $table->timestamp('added_on');
		    $table->string('ip_address');

		    
		    $table->index('item_id');
		    $table->index('ip_address');

		});
	}
780393
public function up()
    {
        Schema::create('lfm_categories', function (Blueprint $table) {
            $table->integer('id', true);
            $table->integer('user_id')->nullable()->unsigned()->default(0);
            $table->string('title')->nullable()->default(null);;
            $table->longText('title_disc')->nullable()->default(null);
            $table->text('description')->nullable()->default(null);
            $table->string('parent_category_id',255)->nullable()->default(null);
            $table->integer('created_by')->unsigned()->nullable()->default(null);
            $table->timestamps();
            $table->softDeletes();
        });

    }
134188
public function up()
    {
        // We need a better way of handling data migrations...
        $system = app(System::class);
        $prefix = $system->getTablePrefix();
        DB::update("INSERT INTO {$prefix}schedules (name, message, scheduled_at, created_at, updated_at) SELECT name, message, scheduled_at, created_at, updated_at FROM {$prefix}incidents WHERE scheduled_at IS NOT NULL");

        DB::table('incidents')->whereNotNull('scheduled_at')->delete();

        Schema::table('incidents', function (Blueprint $table) {
            $table->dropColumn('scheduled_at');
        });
    }
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();
        });
    }
399762
public function up(): void
    {
        Schema::create('hc_language', function (Blueprint $table) {
            $table->increments('count');
            $table->uuid('id')->unique();
            $table->datetime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->datetime('updated_at')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->datetime('deleted_at')->nullable();

            $table->string('language_family');
            $table->string('language');
            $table->string('native_name');
            $table->string('iso_639_1', 2)->index();
            $table->string('iso_639_2', 3);

            $table->boolean('is_content')->default(0);
            $table->boolean('is_interface')->default(0);
        });
    }
1118034
public function up() {
		$db = Database::get();

		$database = $db->get_one('SELECT DATABASE()');

		$indexes = ['completed', 'frozen', 'failed'];

		foreach ($indexes as $index) {
			if ($db->get_one('SELECT 1 FROM INFORMATION_SCHEMA.STATISTICS WHERE 1 AND TABLE_SCHEMA = "' . $database . '" AND TABLE_NAME="transaction" AND INDEX_NAME="' . $index . '"') === null) {
				$db->query('ALTER TABLE `transaction` ADD INDEX `' . $index . '` (`' . $index . '`)');
			}
		}
	}
1335057
public function migrateUp()
    {
        $this->builder->create(
            $this->table,
            function ($table) {
                $table->bigIncrements('id');

                $table->string('sha1', 40)->index();
                $table->text('statement');
                $table->double('time')->index();
                $table->integer('connection_id')->unsigned();

                $table->timestamps();
                $table->index('created_at');
                $table->index('updated_at');
            }
        );
    }
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();
        });
    }