2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/generators/active_record/templates/migration.rb', line 2
def self.up
create_table :media do |t|
t.integer :width
t.integer :height
t.integer :size
t.string :content_type t.string :url
t.string :filename t.string :thumbnail
t.integer :encode_status t.string :type t.string :status
t.string :context t.string :file t.timestamps
end
add_index :media, :encode_status
add_index :media, [:type, :context]
create_table :media_links do |t|
t.integer :medium_id t.integer :mediated_id t.string :mediated_type
t.timestamps
end
add_index :media_links, :medium_id
add_index :media_links, [:mediated_id, :mediated_type]
end
|