Project

General

Profile

Feature #266 ยป 0001-Fixes-266-Migrate-the-NFS-paths-of-existing-Installa.patch

installation media path migration - Jochen Schalanda, 05/24/2010 09:39 AM

View differences:

db/migrate/20100524080302_migrate_installation_media_uri.rb
class MigrateInstallationMediaUri < ActiveRecord::Migration
def self.up
Media.all.each { |medium|
matches = /^([^:]+):(\/.+)/.match(medium.path)
if matches.size == 3 and ![ 'http', 'https', 'ftp', 'ftps', 'nfs' ].include?(matches[1])
medium.path = 'nfs://' + matches[1] + matches[2]
medium.save
end
}
end
def self.down
end
end
    (1-1/1)