forked from ManageIQ/manageiq-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb
34 lines (29 loc) · 1.47 KB
/
20170928202851_migrate_middleware_server_to_wildfly_and_eap.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class MigrateMiddlewareServerToWildflyAndEap < ActiveRecord::Migration[5.0]
class MiddlewareServer < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end
def up
say_with_time('Migrating middleware_server to middleware_server_wildfly') do
MiddlewareServer
.where("type = ? AND product ~* ?", 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer', 'wildfly')
.update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly')
end
say_with_time('Migrating middleware_server to middleware_server_eap') do
MiddlewareServer
.where("type = ? AND product ~* ?", 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer', 'eap')
.update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap')
end
end
def down
say_with_time('Migrating middleware_server_wildfly to middleware_server') do
MiddlewareServer
.where(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerWildfly')
.update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer')
end
say_with_time('Migrating middleware_server_eap to middleware_server') do
MiddlewareServer
.where(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServerEap')
.update_all(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager::MiddlewareServer')
end
end
end