Feature #266 ยป 0001-Fixes-266-Migrate-the-NFS-paths-of-existing-Installa.patch
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
|