Dispatches the migration process

@throws Exception\LockNotAcquirableException
@throws Exception\HistoryHasSourceUnknownUnitsOfWorkException
@throws Exception\UnitIsAlreadyPresentException

@return void
549768
public function dispatch()
    {
        $this->lock->acquire();

        $this->guardThatHistoryRepositoryDoesNotHaveMoreUnitsOfWork();

        $workloadRepository = $this->sourceRepository->diff(
            $this->historyRepository
        );

        foreach ($workloadRepository as $unitOfWork) {
            $this->executeMigration($unitOfWork);
        }

        $this->historyRepository->persist();

        $this->lock->release();
    }
112988
public function migrateUp()
    {
        $this->builder->table(
            $this->table,
            function ($table) {
                $table->string('medium')->nullable()->index();
                $table->string('source')->nullable()->index();
                $table->string('search_terms_hash')->nullable()->index();
            }
        );

        $this->builder->table($this->foreign, function ($table) {
            $table->foreign('referer_id', 'tracker_referers_referer_id_fk')
                ->references('id')
                ->on('tracker_referers')
                ->onUpdate('cascade')
                ->onDelete('cascade');
        });
    }
1296622
public function create() {
        $migration = $this->getMessages();
        if (!$migration) {
            $this->db()->insert($this->table, array('migration' => get_class($this), 'state' => false));
        } else {
            throw new \Exception('Migration ' .  get_class($this) . ' already created');
        }
    }
1023925
public function process()
    {
        $this->argumentName = $this->argument('name');
        $this->appDir = CYGNITE_BASE.DS.APPPATH;
        $migrateTemplateDir =
            dirname(dirname(__FILE__)).DS.'src'.DS.'Apps'.DS.'Database'.DS;

        $migrateInstance = null;
        $migrateInstance = Migrator::instance($this);
        $this->table()->makeMigration('migrations');

        // We will generate migration class only if class name provided in command
        if (!is_null($this->argumentName)) {
            $migrateInstance->setTemplateDir($migrateTemplateDir);
            $migrateInstance->replaceTemplateByInput();
            $file = $migrateInstance->generate(new \DateTime('now', new \DateTimeZone(SET_TIME_ZONE)));

            if ($file) {
                $file = APP_NS.DS.'Resources'.DS.'Database'.DS.'Migrations'.DS.$file;
                $this->info('Your migration class generated in '.$file);
            }

            $this->info('Cool!! You are ready to use migration!');
        }
    }
4498
public function execute(): void
	{
		$migrations = $this->getOutstanding();

		if(empty($migrations))
		{
			$this->write('<blue>There are no outstanding migrations.</blue>');

			return;
		}

		$batch = $this->builder()->max('batch') + 1;

		foreach($migrations as $migration)
		{
			$this->runMigration($migration, 'up', $batch);
		}

		$this->write('Ran the following migrations:' . PHP_EOL);

		$this->outputMigrationList($migrations);
	}
852183
public function up()
    {
        Schema::table('incidents', function (Blueprint $table) {
            $table->timestamp('occurred_at')->nullable()->after('scheduled_at');
        });

        // We need a better way of handling data migrations...
        $system = app(System::class);
        $prefix = $system->getTablePrefix();

        DB::update("UPDATE {$prefix}incidents SET occurred_at = created_at");
    }
1268339
public function up()
    {
        $this->createSchema(function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('slug');
            $table->string('description')->nullable();
            $table->timestamps();

            $table->unique(['slug']);
        });
    }
537493
public function migrateUp()
    {
        try {
            $this->builder->table(
                $this->table,
                function ($table) {
                    $table->string('value')->nullable()->change();
                }
            );
        } catch (\Exception $e) {
            dd($e->getMessage());
        }
    }
1336139
public static function migrate()
    {
        foreach (static::$foreignKeys as $foreignKey) {
            Schema::table($foreignKey['table'], function (Blueprint $table) use ($foreignKey) {
                $table->foreign($foreignKey['column'], $foreignKey['key_name'])
                ->references($foreignKey['primary_key'])
                ->on($foreignKey['reference_table'])
                ->onDelete($foreignKey['on_delete'])
                ->onUpdate($foreignKey['on_update']);
            });
        }

        static::$foreignKeys = [];
    }
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');
        });
    }
601853
private function buildMigrations()
    {
        $unitDataArray = $this->loadUnitDataIteratorFromDatabase();
        foreach ($unitDataArray as $unitData) {
            $unitOfWork = UnitOfWorkFactory::BuildFromFlatArray($unitData);
            $this->presentUidsOnConstruction[$unitOfWork->getUniqueId()] = true;
            $this->add($unitOfWork);
        }
    }
454789
public function up()
    {
        Schema::create(config('laranixauth.usergroup.table'), function (Blueprint $table) {
            $table->unsignedInteger('user_id');
            $table->unsignedSmallInteger('group_id');
            $table->unsignedTinyInteger('primary')->default(0);
            $table->unsignedTinyInteger('hidden')->default(0);

            $table->timestamps();

            $table->primary(['user_id', 'group_id']);

            $table->foreign('user_id')
                ->references('id')
                ->on(config('laranixauth.user.table'))
                ->onUpdate('cascade')
                ->onDelete('cascade');

            $table->foreign('group_id')
                ->references('id')
                ->on(config('laranixauth.group.table'))
                ->onUpdate('cascade')
                ->onDelete('restrict');
        });
    }
369385
public function up()
    {
        Schema::create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue')->index();
            $table->longText('payload');
            $table->unsignedTinyInteger('attempts');
            $table->unsignedInteger('reserved_at')->nullable();
            $table->unsignedInteger('available_at');
            $table->unsignedInteger('created_at');
        });
    }
62763
public function process()
    {
        // Migrate init - to create migration table
        $name = $this->argument('name');

        if (!is_null($name)) {
            if (string_has($name, ',')) {
                $this->seeder()->executeOnly($name);
            } else {
                $this->seeder()->executeOnly($name);
            }
        }

        $this->seeder()->run();

        $this->info('Seeding Completed Successfully!');
    }
1107875
public function up()
    {
        $table = $this->table('users');

        if (!$table->hasColumn('firstname')) {
            $table->addColumn('firstname', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'after' => 'language_id']);
        }

        if (!$table->hasColumn('lastname')) {
            $table->addColumn('lastname', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'after' => 'firstname']);
        }

        $table->update();

        $this->clearModelCache();
    }
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();
    }
651561
protected function migrate()
    {
        $this->console->call(
            'migrate',
            ['--scope' => $this->addon->slug(), '--force' => true],
            $this->command ? $this->command->getOutput() : null
        );
    }