2017-08-31 00:06:56 -04:00
|
|
|
class AddExtensionToUploads < ActiveRecord::Migration[4.2]
|
2017-07-03 13:06:54 -04:00
|
|
|
def up
|
|
|
|
add_column :uploads, :extension, :string, limit: 10
|
|
|
|
execute "CREATE INDEX index_uploads_on_extension ON uploads(lower(extension))"
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_column :uploads, :extension
|
|
|
|
execute "DROP INDEX index_uploads_on_extension"
|
|
|
|
end
|
|
|
|
end
|