2016-05-16 126 views
-1

我遇到了我的應用問題。Can not heroku運行rake db:migrate

我試圖運行:

heroku run rake db:migrate 

,但我得到這個錯誤:

Running rake db:migrate on pierwsza1... up, run.7908 
    ActiveRecord::SchemaMigration Load (22.9ms) SELECT "schema_migrations".* FROM "schema_migrations" 
Migrating to AddUserIdToPins (20160515200705) 
    (1.9ms) BEGIN 
== 20160515200705 AddUserIdToPins: migrating ================================== 
-- add_column(:pins, :user_id, :integrer) 
    (3.6ms) ALTER TABLE "pins" ADD "user_id" integrer 
    (8.6ms) ROLLBACK 
rake aborted! 
StandardError: An error has occurred, this and all later migrations canceled: 
PG::UndefinedObject: ERROR: type "integrer" does not exist 
LINE 1: ALTER TABLE "pins" ADD "user_id" integrer 

這是我與rails generate migration add_user_id_to_pins user_id:integer:index:

class AddUserIdToPins < ActiveRecord::Migration 
    def change 
    add_column :pins, :user_id, :integer 
    add_index :pins, :user_id 
    end 
end 

回答

0

中產生的文件的內容您已將遷移文件user_id定義爲整合r ER代替integer

你只需要一個有效的類型

0

檢查這一行你的日誌的更新您的遷移文件:

PG::UndefinedObject: ERROR: type "integrer" does not exist 
LINE 1: ALTER TABLE "pins" ADD "user_id" integrer 

它明確指出,你打錯「整數「與」整合「。請在您的文件中更正。

相關問題