From 5e44987271726663b3e436eb9edad76d17bd9779 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Thu, 6 Dec 2012 06:33:46 -0800 Subject: [PATCH] Really fix this by resetting schema cache --- .../migrate/20110422000000_convert_binary.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/data/sql/migrate/20110422000000_convert_binary.rb b/data/sql/migrate/20110422000000_convert_binary.rb index 5e8e542381..4fa3428ad1 100755 --- a/data/sql/migrate/20110422000000_convert_binary.rb +++ b/data/sql/migrate/20110422000000_convert_binary.rb @@ -16,6 +16,10 @@ class ConvertBinary < ActiveRecord::Migration end def self.up + rename_column :web_pages, :body, :body_text + rename_column :web_pages, :request, :request_text + rename_column :web_vulns, :request, :request_text + rename_column :web_vulns, :proof, :proof_text add_column :web_pages, :body, :binary add_column :web_pages, :request, :binary @@ -31,10 +35,20 @@ class ConvertBinary < ActiveRecord::Migration remove_column :web_pages, :request_text remove_column :web_vulns, :request_text remove_column :web_vulns, :proof_text + + WebPage.connection.schema_cache.clear! + WebPage.reset_column_information + WebVuln.connection.schema_cache.clear! + WebVuln.reset_column_information end def self.down + rename_column :web_pages, :body, :body_binary + rename_column :web_pages, :request, :request_binary + rename_column :web_vulns, :request, :request_binary + rename_column :web_vulns, :proof, :proof_binary + add_column :web_pages, :body, :text add_column :web_pages, :request, :text add_column :web_vulns, :request, :text @@ -50,5 +64,9 @@ class ConvertBinary < ActiveRecord::Migration remove_column :web_vulns, :request_binary remove_column :web_vulns, :proof_binary + WebPage.connection.schema_cache.clear! + WebPage.reset_column_information + WebVuln.connection.schema_cache.clear! + WebVuln.reset_column_information end end