मैं निम्न माइग्रेशन प्रदर्शन करने के लिए प्रदर्शन कर रहा पर "ट्वीट" मॉडल की मेजरेल प्रवासन समय त्रुटि Heroku
class ChangeDataTypeForTweetsNumber < ActiveRecord::Migration
def up
change_column :tweets do |t|
t.change :number, :integer
end
end
def down
change_table :tweets do |t|
t.change :number, :string
end
end
end
में स्तंभ "संख्या" बदलने के लिए कोशिश कर रहा हूँ करने के लिए जोर दे रहा डब्ल्यू/Postgres निम्नलिखित Heroku के लिए प्रवास ....
heroku rake db:migrate:up VERSION=20120925211232
मैं निम्नलिखित त्रुटि मिलती है
PG::Error: ERROR: column "number" cannot be cast to type integer
: ALTER TABLE "tweets" ALTER COLUMN "number" TYPE integer
कोई विचार आपके पास बहुत सराहना की जाएगी।
सभी को धन्यवाद।
बहुत ही दिलचस्प - धन्यवाद! – dougiebuckets
इसे करने के लिए एक संक्षिप्त और बेवकूफ तरीका के लिए, नीचे रिले का जवाब देखें! – danmaz74
@ danmaz74: क्या आप जानते हैं कि 2012 में यह उपलब्ध था या क्या मुझे कुछ याद आया? –