私は生産のための私のアプリケーションが準備されている、と私は私のデータベースを掻き集めるに苦しんでいます。それは私に、このエラーを与えている。ここでPG ::レール上UndefinedTable ERRORルビーHerokuの
PG::UndefinedTable: ERROR: relation "events" does not exist
: ALTER TABLE "events" ADD "code" character varying
は私のdatabase.ymlのファイルです:
class CreateEvents < ActiveRecord::Migration[5.0]
def change
create_table :events do |t|
t.string :name
t.string :partycode
t.references :user, foreign_key: true
t.timestamps
end
end
end
EDIT: Iここで
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: postgresql
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
production:
<<: *default
database: db/production.postgresql
私のイベントの移行ファイルであります :実行
rake db:migrate:status
私は、次のような結果を得ます最後に、ここに私のgemfileがあります:
source 'http://rubygems.org'
gem 'bootstrap-sass', '3.2.0.2'
gem 'bcrypt', '3.1.11'
gem 'will_paginate'
gem 'responders'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem "heroku"
gem 'coffee-script-source', '1.8.0'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'sqlite3'
gem 'byebug', platform: :mri
end
group :production do
gem 'web-console'
gem 'pg'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
ruby "2.2.4"
私が持っているこの問題を解決するために必要なものが他にもあります。ありがとう:D
それでは、どのように私は、これら2の順序を変更するに行きますか?この@Aaron – Aaron
は、移行シーケンスを変更するためにあなたhttp://stackoverflow.com/questions/10456761/rails-migration-change-sequence-or-orderを助けるかもしれません。一方、一時的な修正を試すことができます。 – Deep
が魅力のように働いた、私は今、私の生産applicaitonを見ることができます – Aaron