Skip to content
Snippets Groups Projects
Commit 7371c9e2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'better-service-migration' into 'master'

Better service migration

Prevent crashes and saving invalid record. Skip non-valid services.

Better fix for https://github.com/gitlabhq/gitlabhq/pull/8199

See merge request !1235
parents 80059cb5 ff48e1ee
No related branches found
No related tags found
No related merge requests found
Loading
@@ -23,7 +23,7 @@ class SerializeServiceProperties < ActiveRecord::Migration
Loading
@@ -23,7 +23,7 @@ class SerializeServiceProperties < ActiveRecord::Migration
associations[service.type.to_sym].each do |attribute| associations[service.type.to_sym].each do |attribute|
service.send("#{attribute}=", service.attributes[attribute.to_s]) service.send("#{attribute}=", service.attributes[attribute.to_s])
end end
service.save(validate: false) service.save
end end
   
remove_column :services, :project_url, :string remove_column :services, :project_url, :string
Loading
Loading
Loading
@@ -10,7 +10,7 @@ class MoveSlackServiceToWebhook < ActiveRecord::Migration
Loading
@@ -10,7 +10,7 @@ class MoveSlackServiceToWebhook < ActiveRecord::Migration
slack_service.properties.delete('subdomain') slack_service.properties.delete('subdomain')
# Room is configured on the Slack side # Room is configured on the Slack side
slack_service.properties.delete('room') slack_service.properties.delete('room')
slack_service.save! slack_service.save
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment