質問失礼します
「rails generate model attendances attendance_time:datetime」でモデルを作成したんですけど、migrateファイルの内容を変更したいんですけど方法がわからないので教えていただけると幸いです。
今のmigrateファイル↓
class CreateAttendances < ActiveRecord::Migration[5.1] def change create_table :attendances do |t| t.datetime :attendance_time t.timestamps end end end
このように変更したいです↓
class CreateAttendances < ActiveRecord::Migration[5.1] def change create_table :attendances do |t| t.date :worked_on t.datetime :started_at t.datetime :finished_at t.string :note t.references :user, foreign_key: true t.timestamps end end end
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/29 06:25
2019/03/29 06:28