class CreateVideos < ActiveRecord::Migration[5.2]
  def change
    create_table :videos do |t|
      t.references :user, index: true, type: :integer
      t.string :title
      t.string :uuid, comment: 'Aliyun媒体ID'
      t.string :cover_url, comment: '视频封面'
      t.string :file_url, comment: '视频地址'

      t.string :status
      t.string :vod_status, comment: 'Aliyun媒体状态'

      t.datetime :published_at, index: true

      t.timestamps

      t.index :uuid, unique: true
    end
  end
end