From bcd1e606bcf4da8fb52ee1a6122b9339f233d62d Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Mon, 3 Feb 2025 08:45:44 +0000 Subject: [PATCH] Add migration files to remove and readd --- .../20250203083533_remove_address_search_from_logs.rb | 11 +++++++++++ .../20250203084427_add_address_search_to_both_logs.rb | 6 ++++++ db/schema.rb | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20250203083533_remove_address_search_from_logs.rb create mode 100644 db/migrate/20250203084427_add_address_search_to_both_logs.rb diff --git a/db/migrate/20250203083533_remove_address_search_from_logs.rb b/db/migrate/20250203083533_remove_address_search_from_logs.rb new file mode 100644 index 000000000..607548376 --- /dev/null +++ b/db/migrate/20250203083533_remove_address_search_from_logs.rb @@ -0,0 +1,11 @@ +class RemoveAddressSearchFromLogs < ActiveRecord::Migration[7.2] + def change + if column_exists?(:sales_logs, :address_search) + remove_column :sales_logs, :address_search + end + + if column_exists?(:lettings_logs, :address_search) + remove_column :lettings_logs, :address_search + end + end +end diff --git a/db/migrate/20250203084427_add_address_search_to_both_logs.rb b/db/migrate/20250203084427_add_address_search_to_both_logs.rb new file mode 100644 index 000000000..f7d8f1df2 --- /dev/null +++ b/db/migrate/20250203084427_add_address_search_to_both_logs.rb @@ -0,0 +1,6 @@ +class AddAddressSearchToBothLogs < ActiveRecord::Migration[7.2] + def change + add_column :sales_logs, :address_search, :string + add_column :lettings_logs, :address_search, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 2c82498a9..76aff25f2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2025_01_30_180704) do +ActiveRecord::Schema[7.2].define(version: 2025_01_30_190507) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"