我有一个列名为主键的用户表。我在其他几个表中引用了这一列。现在我想将用户表ID列的数据类型更改为Bigint。所以,我将'integer'更改为'bigint'并成功生成实体。但是,如果我尝试更新模式,它就会失败。请在此建议。Symfony 2模式更新在将主键数据类型从整数更改为Bigint时失败
主表(用户)YML:
table: users
id:
id:
type: bigint
generator: { strategy: AUTO }
实施例引用表(user_profiles)YML:
oneToOne:
user_id:
targetEntity: Users
inversedBy: userprofile
joinColumn:
name: user_id
referencedColumnName: id
错误上
php app/console doctrine:schema:update --force
[Doctrine\DBAL\Exception\DriverException] An exception occurred while executing 'ALTER TABLE user_claim A DD CONSTRAINT FK_CDFFA2C4A76ED395 FOREIGN KEY (user_id) REFERENCES users (id)': SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
我在MySQL命令试图SET FOREIGN_KEY_CHECKS=0;
也提示。但没用。
有没有任何选项来更新模式没有外键检查? – Radhakrishna