Rails 3,迁移在本地工作,在Heroku中不起作用?
问题描述:
我最近公布的this questionRails 3,迁移在本地工作,在Heroku中不起作用?
与我选择正确的答案在本地工作,这里是我主要使用的迁移:
class ChangeColumnToUsers < ActiveRecord::Migration
def self.up
change_column :users, :created_at, :datetime
end
def self.down
change_column :users, :created_at, :string
end
end
运行的Heroku耙分贝后:迁移,我收到此错误:
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: column "deadline" cannot be cast to type "date"
: ALTER TABLE "tasks" ALTER COLUMN "deadline" TYPE date
(See full trace by running task with --trace)
(in /disk1/home/slugs/18c5c920-2e22-40f5-8d6a-b20a0fc5d7ba/mnt)
== ChangeColumnToUsers: migrating ============================================
-- change_column(:users, :created_at, :datetime)
任何想法?
答
我会迁移回,删除字段,创造了新的领域。
我做了这么多次,像一个魅力工作。