一度scaffoldで新しく作成したのですが、一部カラムが抜けているのを忘れていた為
一度取り消しを行い再度scaffoldを行いました
(とりけし→rails destroy scaffold services)
再度のscaffold 自体は問題なくできたのですが
起動させようとすると下記エラーが出てきます
PG::Error: ERROR: relation "services" already exists : CREATE TABLE "services" ("id" serial primary key, "name" character varying, "district" character varying, "help" text, "selfintroduction" text, "tadameshi" text, "deadline" timestamp, "created_at" timestamp NOT NULL, "updated_at" timestamp NOT NULL) /home/vagrant/workspace/tadameshi/db/migrate/20180213042940_create_services.rb:3:in `change'
下記から想定される原因はすでにserviceという関係が存在するためできませんと出てきます
そのため、一度migrateを取り消しをする
https://joppot.info/2014/10/14/2073
を実行する、その他ぐぐって解決策はないかさがしたのですがエラーが消えません
なにか解決策などはないでしょうか・・・?
何卒宜しくお願いいたしますm(_ _)m
その他コードを下記に記載します
DB
class CreateServices < ActiveRecord::Migration def change create_table :services do |t| t.string :name t.string :district t.text :help t.text :selfintroduction t.text :tadameshi t.datetime :deadline t.timestamps null: false end end end
またぐぐると下記サイトがある様子ですが・・・
https://gitlab.com/gitlab-org/gitlab-ce/issues/34271
https://stackoverflow.com/questions/46400787/pgundefinedtable-error-relation-services-does-not-exist-line-1-select-se
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/02/13 14:10