Class: CreateVideos

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

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
24
# File 'lib/generators/merrycms/templates/create_videos_migration.rb', line 21

def self.down
  drop_table :videos
  drop_table :sources
end

.upObject



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

def self.up
  create_table :videos do |t|
    t.string    :title
    t.timestamps
  end
  
  create_table :sources do |t|
    t.integer   :video_id
    t.string    :width
    t.string    :height
    t.string    :container_type
    t.string    :video_file_name
    t.string    :video_content_type
    t.integer   :video_file_size
    t.datetime  :video_updated_at
  end
  
end