2
오늘 아침부터 레일스의 이상한 문제에 직면하고 있습니다. 다음은 내 ls 및 rake db version 명령의 출력입니다.레일 마이 그 레이션 버전 문제 : 새 마이 그 레이션이 작동하지 않습니다.
[email protected]:~/git-public/personaldiary/db/migrate$ ls -1
20120110083934_devise_create_users.rb
20120110090514_create_posts.rb
20120110090845_add_user_id_to_post.rb
20120203035323_add_confirmable_to_devise.rb
20120203035323_add_confirmable_to_devise.rb~
20120203043601_add_lockable_to_devise.rb
20120203043601_add_lockable_to_devise.rb~
[email protected]:~/git-public/personaldiary/db/migrate$ rake db:version
(in /home/hrishikesh/git-public/personaldiary)
DEPRECATION WARNING: require "activerecord" is deprecated and will be removed in Rails 3. Use require "active_record" instead. (called from /usr/lib/ruby/vendor_ruby/activerecord.rb:2)
Current version: 20120203034555
[email protected]:~/git-public/personaldiary/db/migrate$
나는 새로운 마이그레이션을 추가하려고하면, 레이크 DB : 마이그레이션은 몇 가지 열이 이미 존재하고, 실패 나에게 말한다 오류가 발생합니다.
내 실패 마이그레이션 코드는 여기에 있습니다 :
class AddConfirmableToDevise < ActiveRecord::Migration
def change
change_table(:users) do |t|
t.confirmable
end
add_index :users, :confirmation_token, :unique => true
end
end
내가 특별히까지 사용하지 않으 때문에 this
방법 아래로 도와주세요.
여기에 실패한 마이그레이션 코드를 붙여 넣을 수 있습니까? – Vik
@Vik : 편집 된 게시물에 세부 정보가 있습니다. – riship89