mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 15:49:55 +08:00
16 lines
431 B
Ruby
16 lines
431 B
Ruby
class RenameShaColumn < ActiveRecord::Migration[4.2]
|
|
def up
|
|
remove_index :uploads, :sha
|
|
rename_column :uploads, :sha, :sha1
|
|
change_column :uploads, :sha1, :string, limit: 40
|
|
add_index :uploads, :sha1, unique: true
|
|
end
|
|
|
|
def down
|
|
remove_index :uploads, :sha1
|
|
change_column :uploads, :sha1, :string, limit: 255
|
|
rename_column :uploads, :sha1, :sha
|
|
add_index :uploads, :sha, unique: true
|
|
end
|
|
end
|