foreman/db/migrate/20100524080302_migrate_installation_medium_uri.rb @ 8a65dff7
db59a916 | Jochen Schalanda | class MigrateInstallationMediumUri < ActiveRecord::Migration
|
|
9f7fadef | Jochen Schalanda | def self.up
|
|
db59a916 | Jochen Schalanda | Medium.all.each { |medium|
|
|
9f7fadef | Jochen Schalanda | 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
|