summaryrefslogtreecommitdiff
path: root/db/migrate/20151209144329_migrate_ci_web_hooks.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20151209144329_migrate_ci_web_hooks.rb')
-rw-r--r--db/migrate/20151209144329_migrate_ci_web_hooks.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20151209144329_migrate_ci_web_hooks.rb b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
new file mode 100644
index 00000000000..825ba1973ff
--- /dev/null
+++ b/db/migrate/20151209144329_migrate_ci_web_hooks.rb
@@ -0,0 +1,13 @@
+class MigrateCiWebHooks < ActiveRecord::Migration
+ include Gitlab::Database
+
+ def up
+ execute(
+ 'INSERT INTO web_hooks (url, project_id, type, created_at, updated_at, push_events, issues_events, merge_requests_events, tag_push_events, note_events, build_events) ' \
+ "SELECT ci_web_hooks.url, projects.id, 'ProjectHook', ci_web_hooks.created_at, ci_web_hooks.updated_at, " \
+ "#{false_value}, #{false_value}, #{false_value}, #{false_value}, #{false_value}, #{true_value} FROM ci_web_hooks " \
+ 'JOIN ci_projects ON ci_web_hooks.project_id = ci_projects.id ' \
+ 'JOIN projects ON ci_projects.gitlab_id = projects.id'
+ )
+ end
+end