|
@@ -12,12 +12,18 @@ class UpdateStorage3 < ActiveRecord::Migration
|
|
|
sha = Digest::SHA256.hexdigest( file.content )
|
|
|
file.update_attribute( :sha, sha )
|
|
|
}
|
|
|
- Store::Provider::DB.all.each {|file|
|
|
|
+ Store::File.all.each {|file|
|
|
|
next if file.sha
|
|
|
sha = Digest::SHA256.hexdigest( file.content )
|
|
|
file.update_attribute( :sha, sha )
|
|
|
}
|
|
|
|
|
|
+ Store::Provider::DB.all.each {|file|
|
|
|
+ next if file.sha
|
|
|
+ sha = Digest::SHA256.hexdigest( file.data )
|
|
|
+ file.update_attribute( :sha, sha )
|
|
|
+ }
|
|
|
+
|
|
|
remove_column :store_files, :md5
|
|
|
remove_column :store_provider_dbs, :md5
|
|
|
end
|