Class: CreateVideos

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/templates/create_videos.rb

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
# File 'lib/generators/templates/create_videos.rb', line 21

def self.down
  drop_table :videos
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/generators/templates/create_videos.rb', line 2

def self.up
  create_table :videos, :force => true do |t|
    t.integer :post_id
    t.string :caption
    t.string :url, :limit => 3000
    t.string :vimeo_id
    t.timestamps

    t.integer :display_order, :default => 0

    t.string :embed, :limit => 3000

    t.integer :width
    t.integer :height
    t.string :thumb_url
  end
  add_index :videos, :post_id
end