Created
November 6, 2017 10:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to apply this patch, in which file i need to add this content.