Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save timogoebel/cd29e5206678ca0e0d78222af70583ec to your computer and use it in GitHub Desktop.
Save timogoebel/cd29e5206678ca0e0d78222af70583ec to your computer and use it in GitHub Desktop.
Skip Dynflow and Foreman Tasks tables when converting Foreman database from MySQL to Postgres
From 7d31b83218e0abad7fdaf4534c8b0629dbc944a3 Mon Sep 17 00:00:00 2001
From: Timo Goebel <mail@timogoebel.name>
Date: Mon, 6 Nov 2017 11:08:28 +0100
Subject: [PATCH] convert: skip foreman tasks tables
---
lib/tasks/convert.rake | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake
index 32b8d35ad..eee74c37e 100644
--- a/lib/tasks/convert.rake
+++ b/lib/tasks/convert.rake
@@ -81,6 +81,8 @@ namespace :db do
ActiveRecord::Base.establish_connection(:production)
skip_tables = ["schema_info", "schema_migrations"]
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
+ next if table_name =~ /^dynflow_/
+ next if table_name =~ /^foreman_tasks_/
time = Time.now
ProductionModelClass.establish_connection(:production)
--
2.13.1
@psureshjack
Copy link

psureshjack commented Feb 3, 2019

How to apply this patch, in which file i need to add this content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment