Navigation

    MemFireDB论坛

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    删除数据表时失败,提示:cannot drop table posts because other objects depend on it

    MemFireDB用户问答
    2
    2
    66
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xiaowa last edited by

      官方样例:https://mp.weixin.qq.com/s/ZXd3EHt8htgY_MaSEydE5Q
      在删除论坛评论表数据表posts时,报错cannot drop table posts because other objects depend on it,无法执行删除该表操作,请问怎么解决?

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @xiaowa last edited by

        @xiaowa 当您创建包含许多具有外键约束,视图,触发器,函数等的表的复杂数据库结构时,将隐式创建对象之间的依赖关系网。
        例如,具有外键约束的表取决于它引用的表。

        为了确保整个数据库结构的完整性, MemFireDB确保您不能删除其他对象仍然依赖的对象。

        解决方法:

        执行下面的命令:

        DROP TABLE posts CASCADE;
        

        所有从属对象将被删除。在这种情况下,它不会删除posts表,而只会删除外键约束。

        1 Reply Last reply Reply Quote 1
        • First post
          Last post