Really fix this by resetting schema cache
parent
a5b3be6dfa
commit
5e44987271
|
@ -16,6 +16,10 @@ class ConvertBinary < ActiveRecord::Migration
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.up
|
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, :body, :binary
|
||||||
add_column :web_pages, :request, :binary
|
add_column :web_pages, :request, :binary
|
||||||
|
@ -31,10 +35,20 @@ class ConvertBinary < ActiveRecord::Migration
|
||||||
remove_column :web_pages, :request_text
|
remove_column :web_pages, :request_text
|
||||||
remove_column :web_vulns, :request_text
|
remove_column :web_vulns, :request_text
|
||||||
remove_column :web_vulns, :proof_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
|
end
|
||||||
|
|
||||||
def self.down
|
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, :body, :text
|
||||||
add_column :web_pages, :request, :text
|
add_column :web_pages, :request, :text
|
||||||
add_column :web_vulns, :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, :request_binary
|
||||||
remove_column :web_vulns, :proof_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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue