Add migration with extension column to uploads.
This commit is contained in:
parent
aad1c9bef2
commit
bb392973ca
|
@ -1,6 +1,6 @@
|
|||
class AddExtensionToTopicLinks < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :topic_links, :extension, :string, limit: 5
|
||||
add_column :topic_links, :extension, :string, limit: 10
|
||||
add_index :topic_links, :extension
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
class AddExtensionToUploads < ActiveRecord::Migration
|
||||
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
|
Loading…
Reference in New Issue