-
Notifications
You must be signed in to change notification settings - Fork 122
Closed
Labels
Milestone
Description
Since Migration 5.x, when I do the following steps :
- I create a table
testusing phpmyadmin with 3 fields :
- id INT AUTOINCREMENT
- title VARCHAR (255)
- description LONGTEXT
- I create a migration file with
bin/cake bake migration_diff CreateTest
This generates the following migration file CreateTest.php :
use Migrations\BaseMigration;
class CreateTest extends BaseMigration
{
public bool $autoId = false;
/**
* Up Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/5/en/migrations.html#the-up-method
*
* @return void
*/
public function up(): void
{
$this->table('test')
->addColumn('id', 'integer', [
'autoIncrement' => true,
'default' => null,
'limit' => null,
'null' => false,
'signed' => false,
])
->addPrimaryKey(['id'])
->addColumn('title', 'string', [
'default' => null,
'limit' => 255,
'null' => false,
])
->addColumn('description', 'text', [
'default' => null,
'limit' => 4294967295,
'null' => false,
])
->create();
}
/**
* Down Method.
*
* More information on this method is available here:
* https://book.cakephp.org/migrations/5/en/migrations.html#the-down-method
*
* @return void
*/
public function down(): void
{
$this->table('test')->drop()->save();
}
}And then, when I try to migrate that migration file, the description field is no longer LONGTEXT but TEXT.
Reactions are currently unavailable