gpt4 book ai didi

rake - rake 迁移期间关系已存在

转载 作者:行者123 更新时间:2023-12-04 02:56:22 26 4
gpt4 key购买 nike

我已经为精炼厂安装了一个博客引擎,它运行良好。

现在我生成了一些表字段更改的迁移(当然不是精炼厂或博客表),但我收到一个错误:

== CreateBlogStructure: migrating ============================================
-- create_table("refinery_blog_posts", {:id=>true})
NOTICE: CREATE TABLE will create implicit sequence "refinery_blog_posts_id_seq1" for serial column "refinery_blog_posts.id"
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::Error: ERROR: relation "refinery_blog_posts" already exists
: CREATE TABLE "refinery_blog_posts" ("id" serial primary key, "title" character varying(255), "body" text, "draft" boolean, "published_at" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL)

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

最佳答案

检查您的 db/schema.rb

除了 db/migrate/[timestamp]your_migration 中的迁移之外,您很可能在那里创建了相同的表

如果 db/migrate/[timestamp]your_migration 与架构中找到的重复并且应该可以工作,则可以删除它。

关于rake - rake 迁移期间关系已存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12602218/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com