我想要修改原则:迁移:diff命令,因为当我运行它时,生成的代码是坏的,所以我想编辑配置文件,但是我不知道它在哪里。
示例错误代码:
public function up(Schema $schema)
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE sessions');
//More sql
}还有更多的sql语句,这些语句都是不修改的,并且会出现。
发布于 2016-06-07 10:34:22
您可以将dbal/dbal配置为忽略sessions表(可能是因为您使用PdoSessionHandler将会话存储在数据库中)。
在config.yml中添加以下行:
doctrine:
dbal:
schema_filter: ~^(?!sessions)~
.....看看symfony网站上的DoctrineMigrationBundle文档
https://stackoverflow.com/questions/37676226
复制相似问题