diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-09 18:31:42 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-10 18:04:08 +0300 |
commit | d5c91bb9a601a1a344d94763654f0b0996857497 (patch) | |
tree | eaacc5a25a57c708a428c73cc38b78f4c2c90f13 /db/migrate/20151209145909_migrate_ci_emails.rb | |
parent | 2988e1fbf50b3c9e803a9358933e3e969e64dcc3 (diff) |
Migrate CI WebHooks and Emails to new tables
Diffstat (limited to 'db/migrate/20151209145909_migrate_ci_emails.rb')
-rw-r--r-- | db/migrate/20151209145909_migrate_ci_emails.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20151209145909_migrate_ci_emails.rb b/db/migrate/20151209145909_migrate_ci_emails.rb new file mode 100644 index 00000000000..ebf0e7d264f --- /dev/null +++ b/db/migrate/20151209145909_migrate_ci_emails.rb @@ -0,0 +1,16 @@ +class MigrateCiEmails < ActiveRecord::Migration + include Gitlab::Database + + def up + execute( + 'INSERT INTO services (project_id, type, created_at, updated_at, active, push_events, issues_events, merge_requests_events, tag_push_events, note_events, build_events, properties) ' \ + "SELECT projects.id, 'BuildsEmailService', ci_services.created_at, ci_services.updated_at, #{true_value}, #{false_value}, #{false_value}, #{false_value}, #{false_value}, #{false_value}, #{true_value}, " \ + "CONCAT('{\"notify_only_broken_builds\":\"', ci_projects.email_only_broken_builds, " \ + "'\",\"add_pusher\":\"', ci_projects.email_add_pusher, '\",\"recipients\":\"', ci_projects.email_recipients, '\"}') " \ + 'FROM ci_services ' \ + 'JOIN ci_projects ON ci_services.project_id = ci_projects.id ' \ + 'JOIN projects ON ci_projects.gitlab_id = projects.id ' \ + "WHERE ci_services.type = 'Ci::MailService' AND ci_services.active" + ) + end +end |