Spot\Adapter\PDO\BaseAbstract::migrate PHP Метод

migrate() публичный Метод

Migrate table structure changes to database
public migrate ( String $table, array $fields, array $options = [] )
$table String Table name
$fields array Fields and their attributes as defined in the mapper
$options array Options that may affect migrations or how tables are setup
    public function migrate($table, array $fields, array $options = array())
    {
        // Setup defaults for options that do not exist
        $options = $options + array('engine' => $this->_engine, 'charset' => $this->_charset, 'collate' => $this->_collate);
        // Get current fields for table
        $tableExists = false;
        $tableColumns = $this->getColumnsForTable($table, $this->_database);
        if ($tableColumns) {
            $tableExists = true;
        }
        if ($tableExists) {
            // Update table
            $this->migrateTableUpdate($table, $fields, $options);
        } else {
            // Create table
            $this->migrateTableCreate($table, $fields, $options);
        }
    }