【问题标题】:Doctrine wants to create tables, which are already existing by schema updateDoctrine 想要创建通过模式更新已经存在的表
【发布时间】:2017-05-26 15:32:45
【问题描述】:

我已经执行了

bin/console d:s:u --force

那么架构就创建成功了。然而,如果我再次执行这个命令,Symfony 想要重新创建模式。这怎么可能?

查看完整的命令行输出:

$ bin/console d:s:u --force
Updating database schema...
Database schema updated successfully!
"7" queries were executed
$ bin/console d:s:u --force
Updating database schema...

[Doctrine\DBAL\Exception\TableExistsException]                        
An exception occurred while executing 'CREATE TABLE message (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, subject VARCHAR(255) NOT NULL, text VARCHAR(255) NOT NULL, INDEX IDX_B6BD307FA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB':
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'message' already exists                                              

[Doctrine\DBAL\Driver\PDOException]                                   
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'message' already exists 

[PDOException]                                                        
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'message' already exists

【问题讨论】:

    标签: doctrine-orm symfony-3.2


    【解决方案1】:

    我有这个配置选项,这导致了麻烦:

    schema_filter: "/user_field_data/"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-14
      • 1970-01-01
      • 2021-01-04
      • 2017-12-04
      • 1970-01-01
      • 1970-01-01
      • 2017-07-21
      • 1970-01-01
      相关资源
      最近更新 更多