Ruby on rails 为什么迁移没有';行不通
我有一个加密程序。(rake-db:migrate:up-VERSION=..)工作正常,但当我尝试回滚迁移(rake-db:migrate:down-VERSION=..)时,它不工作。任何错误或警告。你能帮我做这个吗Ruby on rails 为什么迁移没有';行不通,ruby-on-rails,ruby,migration,Ruby On Rails,Ruby,Migration,我有一个加密程序。(rake-db:migrate:up-VERSION=..)工作正常,但当我尝试回滚迁移(rake-db:migrate:down-VERSION=..)时,它不工作。任何错误或警告。你能帮我做这个吗 def self.up change_table :users do |t| t.token_authenticatable end add_index :users, :authentication_token, :unique => true en
def self.up
change_table :users do |t|
t.token_authenticatable
end
add_index :users, :authentication_token, :unique => true
end
def self.down
remove_index :users, :authentication_token
remove_column :users, :authentication_token
end
这应该是诀窍。我认为您将表令牌命名为authenticatable,然后试图删除authentication令牌
def self.up
create_table :reviews do |t|
t.column :authentication_token
end
add_index :users, :authentication_token, :unique => true
end
def self.down
remove_index :users, :authentication_token
remove_column :users, :authentication_token
end
没有错误?这是哪个版本的rails?