-2
我試圖運行db:通過回形針gem安裝圖像附件後遷移,它不會允許我執行遷移。有人可以幫忙嗎?非常感謝This is what it said on my terminal無法運行db:在Rails中遷移
這是我的配置文件config/database.yml
這是我創建項目表:
class CreateTodoItems < ActiveRecord::Migration[5.0]
def change
create_table :todo_items do |t|
t.column :content
t.column :deadline
t.references :todo_list, foreign_key: true
t.timestamps
end
end
end
項目模型
class TodoItem < ActiveRecord::Base
belongs_to :todo_list
has_attached_file :image, styles: { medium: "500x500>", thumb: "100x100#"}
validates_attachment_content_type :image, content_type: /\Aimage\/.*\z/
def completed?
!completed_at.blank?
end
end
請發表你的config/database.yml文件 – jaysoifer
默認:默認 適配器:sqlite3的 池:5 超時:5000 發展: <<:*默認 數據庫:DB/development.sqlite3 #警告:定義爲 「測試」 數據庫將被刪除,從開發DAT #重新生成當你運行「耙」時放棄。 #不要將此數據庫設置爲與開發或生產相同。 測試: <<:*默認 數據庫:DB/test.sqlite3 生產: <<:*默認 數據庫:DB/production.sqlite3 –
@jaysoifer:默認:默認 適配器:sqlite3的 池:5 超時:5000 發展: <<:*默認 數據庫:DB/development.sqlite3 測試: <<:*默認 數據庫:DB/test.sqlite3 生產: <<:*默認 數據庫:db/production.sqlite3 –