外国人 - 删除外键

 LIU在笑_139 发布于 2023-01-14 15:51
  • php
  • 我想在我的rails 4 app中使用mailboxer.当我尝试部署数据库时出现问题.创建邮箱会话表时出错,该表在通知表中具有依赖关系.

    我正在尝试删除通知对话的外键.

    我创建了一个迁移说:

    change_table :notifications do |t|
    t.remove_foreign_key :conversations
    

    但是,rake中止并说外键不存在.

    rake aborted!
    An error has occurred, this and all later migrations canceled:
    
    PG::UndefinedObject: ERROR:  constraint "notifications_conversation_id_fk" of relation      "notifications" does not exist
    

    我的架构包括:add_foreign_key"notifications","conversation",name:"notifications_on_conversation_id"

    我试图挖掘db:migrate:down创建邮箱的原始迁移,但也收到错误,说'找不到命令'.

    有人可以帮忙吗?谢谢.

    撰写答案
    今天,你开发时遇到什么问题呢?
    立即提问
    热门标签
    PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
    Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有