2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-31 00:06:56 -04:00
|
|
|
class RenameShaColumn < ActiveRecord::Migration[4.2]
|
2013-06-17 16:16:14 -04:00
|
|
|
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
|