public function testTinyIntegerColumn() { $table = new \Phinx\Db\Table('t', array(), $this->adapter); $table->addColumn('column1', 'integer', array('limit' => MysqlAdapter::INT_TINY))->save(); $columns = $table->getColumns('t'); $sqlType = $this->adapter->getSqlType($columns[1]->getType(), $columns[1]->getLimit()); $this->assertEquals('tinyint', $sqlType['name']); }
public function testIntegerColumnLimit() { $limit = 8; $table = new \Phinx\Db\Table('t', array(), $this->adapter); $table->addColumn('column1', 'integer', array('limit' => $limit))->save(); $columns = $table->getColumns('t'); $sqlType = $this->adapter->getSqlType($columns[1]->getType(), $columns[1]->getLimit()); $this->assertEquals($limit, $sqlType['limit']); }
/** * Change Method. * * Write your reversible migrations using this method. * * More information on writing migrations is available here: * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class * * @return void */ public function change() { $table = $this->table('queued_tasks'); try { $adapter = new MysqlAdapter([]); if ($adapter->getSqlType('text', 'longtext')) { $table->changeColumn('data', 'text', ['limit' => MysqlAdapter::TEXT_LONG, 'null' => true, 'default' => null]); } } catch (Exception $e) { Debugger::dump($e->getMessage()); } }