我在 Rails 5.1 中创建引用时遇到问题。虽然 rails 5.1 使用 bigint(20) 作为默认 id,但旧的仍然使用 integer(11),这会导致创建外键的问题(当新表(rails 5.1)与旧表关联时)。现在我想将所有旧的 id 类型更改为 bigint,我已经为它创建了迁移,但我遇到了另一个问题:```
Mysql2::Error: Cannot change column 'id': used in a foreign key constraint 'fk_rails_8faf9b95af' of table 'bene_fitness_server_development.messages': ALTER TABLE `chat_groups` CHANGE `id` `id` bigint NOT NULL
```如何通过rails用外键改变列?