mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:50:00 +08:00
Add migration with extension column to uploads.
This commit is contained in:
parent
aad1c9bef2
commit
bb392973ca
|
@ -1,6 +1,6 @@
|
||||||
class AddExtensionToTopicLinks < ActiveRecord::Migration
|
class AddExtensionToTopicLinks < ActiveRecord::Migration
|
||||||
def change
|
def change
|
||||||
add_column :topic_links, :extension, :string, limit: 5
|
add_column :topic_links, :extension, :string, limit: 10
|
||||||
add_index :topic_links, :extension
|
add_index :topic_links, :extension
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
db/migrate/20170703115216_add_extension_to_uploads.rb
Normal file
11
db/migrate/20170703115216_add_extension_to_uploads.rb
Normal file
|
@ -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
Block a user