Created
August 20, 2010 17:19
-
-
Save adriand/540755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddVideoFields < ActiveRecord::Migration | |
def self.up | |
add_column :videos, :thumbnail_file_name, :string | |
add_column :videos, :thumbnail_content_type, :string | |
add_column :videos, :thumbnail_file_size, :integer | |
add_column :videos, :thumbnail_updated_at, :datetime | |
add_column :videos, :video_file_name, :string | |
add_column :videos, :video_content_type, :string | |
add_column :videos, :video_file_size, :integer | |
add_column :videos, :video_updated_at, :datetime | |
add_column :videos, :job_id, :string | |
add_column :videos, :encoded_state, :string, :default => "unencoded" | |
add_column :videos, :output_url, :string | |
add_column :videos, :duration_in_ms, :integer | |
# due to issues with Flash players, it is sometimes useful to manually set aspect ratio: | |
add_column :videos, :aspect_ratio, :string | |
end | |
def self.down | |
remove_column :videos, :aspect_ratio | |
remove_column :videos, :duration_in_ms | |
remove_column :videos, :output_url | |
remove_column :videos, :encoded_state | |
remove_column :videos, :job_id | |
remove_column :videos, :thumbnail_file_name | |
remove_column :videos, :thumbnail_content_type | |
remove_column :videos, :thumbnail_file_size | |
remove_column :videos, :thumbnail_updated_at | |
remove_column :videos, :video_file_name | |
remove_column :videos, :video_content_type | |
remove_column :videos, :video_file_size | |
remove_column :videos, :video_updated_at | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment