Update migrations table to reflect the migration push.

@param string $migration

@return void
545581
private function changeMigrationTable($migration)
    {
        $table = $this->_cap->table('migrations');

        $dbm = $table->where('migration', '=', $migration);

        if ($dbm->count() > 0) {
            $item = $dbm->first();
            $item->updated_at = date('Y-m-d h:i:s');
            $item->migrated = 1;
            $table->update((array) $item);
        } else {
            $options['migration'] = $migration;
            $options['created_at'] = date('Y-m-d h:i:s');
            $options['updated_at'] = $options['created_at'];
            $options['migrated'] = 1;
            $table->insert($options);
        }
    }
378766
protected function setupMigrations()
    {
        $migrations = realpath(__DIR__.'/../database/migrations');

        $this->publishes([
            $migrations    => $this->app->databasePath() . '/migrations',
        ]);
    }
1367146
public function down(Migration $migration, $loadFromFile = false)
    {
        if ($loadFromFile) {
            $this->fileRepository->loadSql($migration);
        } else {
            $this->dbRepository->loadSql($migration);
        }

        $func = function () use ($migration) {
            $this->_processMigrationSql($migration->getDown());
            $this->dbRepository->delete($migration);
        };

        $this->_processMigration($migration, $func);
    }
572661
public function updateMigration(MigrationCapsule $migration)
    {
        $key = $this->getMigrationIndex($migration->name);

        if ($key > -1) {
            $current = $this->migrations[$key];
            $this->migrations[$key] = $migration;
            if ($current->path != $migration->path) {
                $this->deleteFile($current->path);
            }
        }
    }
831532
public function updateMigration($type = 'up')
    {
        $file = $class = null;
        $file = $this->getAppMigrationDirPath().$this->getVersion().$this->getMigrationClass();

        if (is_readable($file.EXT)) {
            include_once $file.EXT;
            $class = Inflector::classify($this->getMigrationClass());
        }

        if (trim($type) !== 'down') {
            $type = 'up';
        }

        //Create migrations table schema if not exists
        $this->command->table()->makeMigration();

        call_user_func_array([new $class(), $type], []);

        $this->updateMigrationTable();

        $this->command->info('Migrated: '.$file.EXT.' OK!');
    }
1227716
public function up(Migration $migration)
    {
        if (!$migration->isNew()) {
            throw new \InvalidArgumentException(__METHOD__.": Expected NEW migration");
        }

        // Загрузить SQL
        $this->fileRepository->loadSql($migration);

        $func = function () use ($migration) {
            $this->_processMigrationSql($migration->getUp());
            $this->getDbRepository()->insert($migration);
        };

        $this->_processMigration($migration, $func);
    }
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');
        });
    }
1006020
protected function runClosureMigration($migration, $direction = 'up')
    {
        if (is_array($migration) && array_key_exists($direction, $migration)) {
            call_user_func($migration[$direction], $this->schemaBuilder);
        } else {
            throw new Exception('Migration file should contain an array with up/down.');
        }
    }
1353512
public function up()
    {
        Schema::create('scaffoldinterfaces', function (Blueprint $table) {
            $table->increments('id');
            $table->String('package');
            $table->String('migration');
            $table->String('model');
            $table->String('controller');
            $table->String('views');
            $table->String('tablename');
            $table->timestamps();
        });
    }
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']);
        });
    }
96525
public function add($migrationName) {
		$list = $this->getList(false);
		if(isset($list[$migrationName]))
			return;
		$list[$migrationName] = ['added'=>time()+microtime(true)];
		$this->writeMigrations($list);
	}
1321267
protected function saveMigrationFile(string $filePath, string $migration): void
    {
        $this->output->writeln(sprintf('Generate migration file: %s', $filePath));
        file_put_contents($filePath, $migration);
    }
877540
public function migrate()
	{
		$this->msg( sprintf( 'Add new type columns for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->tables as $rname => $list ) {
			$this->addColumn( $rname, $list );
		}

		$this->msg( sprintf( 'Drop old unique indexes for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->constraints as $rname => $list ) {
			$this->dropIndex( $rname, $list );
		}

		$this->msg( sprintf( 'Migrate typeid to type for Laravel' ), 0 );
		$this->status( '' );

		foreach( $this->migrations as $rname => $list ) {
			$this->migrateData( $rname, $list );
		}
	}
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');
        });
    }
946181
protected function executeMigrations(array $migrations)
	{
		if ( !$migrations ) {
			return;
		}

		$db = $this->_context->getDatabase();

		foreach ( $migrations as $migration ) {
			$db->beginTransaction();
			$migration_type = pathinfo($migration, PATHINFO_EXTENSION);

			$this->_migrationRunners[$migration_type]->run(
				$this->_migrationsDirectory . '/' . $migration,
				$this->_context
			);

			$sql = 'INSERT INTO Migrations (Name, ExecutedOn)
					VALUES (:name, :executed_on)';
			$db->perform($sql, array('name' => $migration, 'executed_on' => time()));
			$db->commit();
		}
	}
673463
public function up(): void
    {
        Schema::create(config('cortex.bookings.tables.services'), function (Blueprint $table) {
            // Columns
            $table->increments('id');
            $table->string('slug');
            $table->{$this->jsonable()}('name');
            $table->{$this->jsonable()}('description')->nullable();
            $table->boolean('is_active')->default(true);
            $table->decimal('base_cost')->default('0.00');
            $table->decimal('unit_cost')->default('0.00');
            $table->string('currency', 3);
            $table->string('unit')->default('hour');
            $table->smallInteger('maximum_units')->unsigned()->nullable();
            $table->smallInteger('minimum_units')->unsigned()->nullable();
            $table->tinyInteger('is_cancelable')->unsigned()->default(0);
            $table->tinyInteger('is_recurring')->unsigned()->default(0);
            $table->mediumInteger('sort_order')->unsigned()->default(0);
            $table->mediumInteger('capacity')->unsigned()->nullable();
            $table->string('style')->nullable();
            $table->auditableAndTimestamps();
            $table->softDeletes();
        });
    }
842884
public function up(): void
    {
        Schema::create(config('cortex.bookings.tables.events'), function (Blueprint $table) {
            // Columns
            $table->increments('id');
            $table->string('slug');
            $table->{$this->jsonable()}('name');
            $table->{$this->jsonable()}('description')->nullable();
            $table->boolean('is_public')->default(true);
            $table->dateTime('starts_at')->nullable();
            $table->dateTime('ends_at')->nullable();
            $table->string('timezone')->nullable();
            $table->string('location')->nullable();
            $table->auditableAndTimestamps();
            $table->softDeletes();
        });
    }