当我运行时php bin/console doctrine:migrations:diff,我总是得到以下新生成的迁移:
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220221174647 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
}
public function down(Schema $schema): void
{
// example with one table but migration generates this for all varchar column, in all tables
$this->addSql('ALTER TABLE address CHANGE company_name company_name VARCHAR(100) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE address_line1 address_line1 VARCHAR(100) DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE zip_code zip_code VARCHAR(10) DEFAULT …Run Code Online (Sandbox Code Playgroud)