7

データベースを移行しようとするとエラーが発生します。どうやってここに来たのか完全には覚えていませんが、次のことを信じています。

  1. 新しいブランチの作成、「リクエスト」のスキャフォールディング、db:migrated、マスターへの切り替え、ブランチのマージ
  2. 別のブランチを作成し、db:migrated などの作業を行い、すべてが正常に機能していました。
  3. heroku postgre データベースから取得したので、実際のデータで動作するかどうかをテストできました。次に、データベースの移行を試みましたが、次のエラーが発生しました:

    rake db:migrate
    ==  CreateRequests: migrating =================================================
    -- create_table(:requests)
    NOTICE:  CREATE TABLE will create implicit sequence "requests_id_seq1" for serial column "requests.id"
    rake aborted!
    An error has occurred, this and all later migrations canceled:
    
    PG::Error: ERROR:  relation "requests" already exists
    : CREATE TABLE "requests" ("id" serial primary key, "title" character varying(255), "content" text, "category" character varying(255), "status" character varying(255), "requested_track_id" integer, "created_at" timestamp, "updated_at" timestamp) 
    

何か案は?

4

2 に答える 2