18 lines
365 B
Ruby
18 lines
365 B
Ruby
class AddThumbnailUuid < ActiveRecord::Migration
|
|
class Thumbnail < ActiveRecord::Base; end
|
|
|
|
def self.up
|
|
add_column :thumbnails, :uuid, :string
|
|
add_index :thumbnails, [:id, :uuid]
|
|
|
|
Thumbnail.find_each do |t|
|
|
t.uuid ||= AutoHandle.generate_securish_uuid
|
|
t.save
|
|
end
|
|
end
|
|
|
|
def self.down
|
|
remove_column :thumbnails, :uuid
|
|
end
|
|
end
|