From 6b387aeddd543e4bd83290488aee70d8656aac17 Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Mon, 10 Mar 2025 15:52:50 +0300 Subject: [PATCH 1/5] Change ActiveRecord::Migration to ActiveRecord::Migration[7.1] Changed the line ActiveRecord::Migration to ActiveRecord::Migration[7.1] so that schema loading could work (it is now required for newer versions of Rails) Updated and commented out the load schema task since it fails to find and run the loading of data into the database PostgreSQL container Added the initialize_profile method and add it to the `after_create` portion of the User factory because of the NameError I encountered: NameError: undefined local variable or method `init_profile' for # (NameError) --- .../db/migrate/20160101154821_create_extensions.rb | 2 +- backend/db/migrate/20160106154821_create_users.rb | 2 +- .../db/migrate/20160119185831_create_profiles.rb | 2 +- .../db/migrate/20160128112500_create_conditions.rb | 2 +- .../20160128114341_create_user_conditions.rb | 2 +- .../db/migrate/20160128191053_create_symptoms.rb | 2 +- .../migrate/20160128191329_create_user_symptoms.rb | 2 +- .../db/migrate/20160128210332_create_trackings.rb | 2 +- .../db/migrate/20160129063945_create_treatments.rb | 2 +- .../20160129064538_create_user_treatments.rb | 2 +- backend/db/migrate/20160211105611_create_tags.rb | 2 +- .../20160224141256_add_demographics_to_profiles.rb | 2 +- .../20160404073700_enable_hstore_extension.rb | 2 +- ...60404073731_add_most_recent_doses_to_profiles.rb | 2 +- .../20160426222232_create_trackable_usages.rb | 2 +- .../20160427055217_add_trackable_usages_counts.rb | 2 +- .../20160608161002_add_screen_name_to_profile.rb | 2 +- ...1182546_add_most_recent_positions_to_profiles.rb | 2 +- backend/db/migrate/20161206135858_create_foods.rb | 2 +- ...d_long_desc_vector_index_on_food_translations.rb | 2 +- .../db/migrate/20161216123757_create_weathers.rb | 2 +- ..._pressure_and_temperature_settings_to_profile.rb | 2 +- .../20170413144043_add_beta_tester_to_profile.rb | 2 +- .../db/migrate/20170504065043_create_crono_jobs.rb | 2 +- .../20170508151200_add_notify_to_profiles.rb | 2 +- .../20170509114220_add_notify_token_to_profiles.rb | 2 +- .../20170612160120_add_slug_name_to_profiles.rb | 2 +- ...0170717153650_add_notify_top_posts_to_profile.rb | 2 +- .../20170731083613_add_global_to_foods_and_tags.rb | 2 +- ...70731123835_add_trackable_usage_count_to_tags.rb | 2 +- .../db/migrate/20170731125044_create_user_tags.rb | 2 +- ...20170801124153_add_trackable_ability_to_foods.rb | 2 +- .../db/migrate/20170817154145_create_positions.rb | 4 ++-- ...70818085110_add_position_reference_to_weather.rb | 2 +- ...170822122800_add_checkin_reminder_to_profiles.rb | 2 +- .../20171011142928_add_rejected_type_to_profiles.rb | 2 +- backend/lib/tasks/app.rake | 2 +- backend/spec/factories/users.rb | 13 +++++++++++++ 38 files changed, 51 insertions(+), 38 deletions(-) diff --git a/backend/db/migrate/20160101154821_create_extensions.rb b/backend/db/migrate/20160101154821_create_extensions.rb index c892ad69..c25c1626 100644 --- a/backend/db/migrate/20160101154821_create_extensions.rb +++ b/backend/db/migrate/20160101154821_create_extensions.rb @@ -1,4 +1,4 @@ -class CreateExtensions < ActiveRecord::Migration[5.1] +class CreateExtensions < ActiveRecord::Migration[7.1] def change enable_extension "pg_trgm" end diff --git a/backend/db/migrate/20160106154821_create_users.rb b/backend/db/migrate/20160106154821_create_users.rb index ca83a304..634dc33a 100644 --- a/backend/db/migrate/20160106154821_create_users.rb +++ b/backend/db/migrate/20160106154821_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration[5.1] +class CreateUsers < ActiveRecord::Migration[7.1] def change create_table :users do |t| ## Database authenticatable diff --git a/backend/db/migrate/20160119185831_create_profiles.rb b/backend/db/migrate/20160119185831_create_profiles.rb index 743760b6..eb3c5738 100644 --- a/backend/db/migrate/20160119185831_create_profiles.rb +++ b/backend/db/migrate/20160119185831_create_profiles.rb @@ -1,4 +1,4 @@ -class CreateProfiles < ActiveRecord::Migration[5.1] +class CreateProfiles < ActiveRecord::Migration[7.1] def change create_table :profiles do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128112500_create_conditions.rb b/backend/db/migrate/20160128112500_create_conditions.rb index 5d41a79e..3f5f83e5 100644 --- a/backend/db/migrate/20160128112500_create_conditions.rb +++ b/backend/db/migrate/20160128112500_create_conditions.rb @@ -1,4 +1,4 @@ -class CreateConditions < ActiveRecord::Migration[5.1] +class CreateConditions < ActiveRecord::Migration[7.1] def up create_table :conditions do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160128114341_create_user_conditions.rb b/backend/db/migrate/20160128114341_create_user_conditions.rb index 97e41ee7..bd7a9b71 100644 --- a/backend/db/migrate/20160128114341_create_user_conditions.rb +++ b/backend/db/migrate/20160128114341_create_user_conditions.rb @@ -1,4 +1,4 @@ -class CreateUserConditions < ActiveRecord::Migration[5.1] +class CreateUserConditions < ActiveRecord::Migration[7.1] def change create_table :user_conditions do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128191053_create_symptoms.rb b/backend/db/migrate/20160128191053_create_symptoms.rb index 74b70e35..d7c8a045 100644 --- a/backend/db/migrate/20160128191053_create_symptoms.rb +++ b/backend/db/migrate/20160128191053_create_symptoms.rb @@ -1,4 +1,4 @@ -class CreateSymptoms < ActiveRecord::Migration[5.1] +class CreateSymptoms < ActiveRecord::Migration[7.1] def up create_table :symptoms do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160128191329_create_user_symptoms.rb b/backend/db/migrate/20160128191329_create_user_symptoms.rb index 449c5ad9..3c4f4cca 100644 --- a/backend/db/migrate/20160128191329_create_user_symptoms.rb +++ b/backend/db/migrate/20160128191329_create_user_symptoms.rb @@ -1,4 +1,4 @@ -class CreateUserSymptoms < ActiveRecord::Migration[5.1] +class CreateUserSymptoms < ActiveRecord::Migration[7.1] def change create_table :user_symptoms do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128210332_create_trackings.rb b/backend/db/migrate/20160128210332_create_trackings.rb index 2131bd01..58864383 100644 --- a/backend/db/migrate/20160128210332_create_trackings.rb +++ b/backend/db/migrate/20160128210332_create_trackings.rb @@ -1,4 +1,4 @@ -class CreateTrackings < ActiveRecord::Migration[5.1] +class CreateTrackings < ActiveRecord::Migration[7.1] def change create_table :trackings do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160129063945_create_treatments.rb b/backend/db/migrate/20160129063945_create_treatments.rb index 23c24585..0ec35c66 100644 --- a/backend/db/migrate/20160129063945_create_treatments.rb +++ b/backend/db/migrate/20160129063945_create_treatments.rb @@ -1,4 +1,4 @@ -class CreateTreatments < ActiveRecord::Migration[5.1] +class CreateTreatments < ActiveRecord::Migration[7.1] def up create_table :treatments do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160129064538_create_user_treatments.rb b/backend/db/migrate/20160129064538_create_user_treatments.rb index eddbe91c..3e81ec25 100644 --- a/backend/db/migrate/20160129064538_create_user_treatments.rb +++ b/backend/db/migrate/20160129064538_create_user_treatments.rb @@ -1,4 +1,4 @@ -class CreateUserTreatments < ActiveRecord::Migration[5.1] +class CreateUserTreatments < ActiveRecord::Migration[7.1] def change create_table :user_treatments do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160211105611_create_tags.rb b/backend/db/migrate/20160211105611_create_tags.rb index 6471b26d..60f02d85 100644 --- a/backend/db/migrate/20160211105611_create_tags.rb +++ b/backend/db/migrate/20160211105611_create_tags.rb @@ -1,4 +1,4 @@ -class CreateTags < ActiveRecord::Migration[5.1] +class CreateTags < ActiveRecord::Migration[7.1] def up create_table :tags do |t| t.timestamps null: false diff --git a/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb b/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb index b5200be8..8661a676 100644 --- a/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb +++ b/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb @@ -1,4 +1,4 @@ -class AddDemographicsToProfiles < ActiveRecord::Migration[5.1] +class AddDemographicsToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :ethnicity_ids_string, :string add_column :profiles, :day_habit_id, :string diff --git a/backend/db/migrate/20160404073700_enable_hstore_extension.rb b/backend/db/migrate/20160404073700_enable_hstore_extension.rb index 1b1f569f..32398fa4 100644 --- a/backend/db/migrate/20160404073700_enable_hstore_extension.rb +++ b/backend/db/migrate/20160404073700_enable_hstore_extension.rb @@ -1,4 +1,4 @@ -class EnableHstoreExtension < ActiveRecord::Migration[5.1] +class EnableHstoreExtension < ActiveRecord::Migration[7.1] def change enable_extension "hstore" end diff --git a/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb b/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb index e4373a80..db76ead2 100644 --- a/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb +++ b/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb @@ -1,4 +1,4 @@ -class AddMostRecentDosesToProfiles < ActiveRecord::Migration[5.1] +class AddMostRecentDosesToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :most_recent_doses, :hstore end diff --git a/backend/db/migrate/20160426222232_create_trackable_usages.rb b/backend/db/migrate/20160426222232_create_trackable_usages.rb index eebe8259..dbf96421 100644 --- a/backend/db/migrate/20160426222232_create_trackable_usages.rb +++ b/backend/db/migrate/20160426222232_create_trackable_usages.rb @@ -1,4 +1,4 @@ -class CreateTrackableUsages < ActiveRecord::Migration[5.1] +class CreateTrackableUsages < ActiveRecord::Migration[7.1] def change create_table :trackable_usages do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb b/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb index 7bddd1ff..8f4ce169 100644 --- a/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb +++ b/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb @@ -1,4 +1,4 @@ -class AddTrackableUsagesCounts < ActiveRecord::Migration[5.1] +class AddTrackableUsagesCounts < ActiveRecord::Migration[7.1] def change add_column :conditions, :trackable_usages_count, :integer, default: 0 add_column :symptoms, :trackable_usages_count, :integer, default: 0 diff --git a/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb b/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb index f09f1361..ae144831 100644 --- a/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb +++ b/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb @@ -1,4 +1,4 @@ -class AddScreenNameToProfile < ActiveRecord::Migration[5.1] +class AddScreenNameToProfile < ActiveRecord::Migration[7.1] def change add_column :profiles, :screen_name, :string end diff --git a/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb b/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb index bf7a523d..a2384a66 100644 --- a/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb +++ b/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb @@ -1,4 +1,4 @@ -class AddMostRecentPositionsToProfiles < ActiveRecord::Migration[5.1] +class AddMostRecentPositionsToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :most_recent_conditions_positions, :hstore add_column :profiles, :most_recent_symptoms_positions, :hstore diff --git a/backend/db/migrate/20161206135858_create_foods.rb b/backend/db/migrate/20161206135858_create_foods.rb index a58652dc..c733be7d 100644 --- a/backend/db/migrate/20161206135858_create_foods.rb +++ b/backend/db/migrate/20161206135858_create_foods.rb @@ -1,4 +1,4 @@ -class CreateFoods < ActiveRecord::Migration[5.1] +class CreateFoods < ActiveRecord::Migration[7.1] def change create_table :foods do |t| t.string :ndb_no diff --git a/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb b/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb index 27faa86e..952f4339 100644 --- a/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb +++ b/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb @@ -1,4 +1,4 @@ -class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration[5.1] +class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration[7.1] disable_ddl_transaction! def up diff --git a/backend/db/migrate/20161216123757_create_weathers.rb b/backend/db/migrate/20161216123757_create_weathers.rb index 2c3ff0cb..db80dd5c 100644 --- a/backend/db/migrate/20161216123757_create_weathers.rb +++ b/backend/db/migrate/20161216123757_create_weathers.rb @@ -1,4 +1,4 @@ -class CreateWeathers < ActiveRecord::Migration[5.1] +class CreateWeathers < ActiveRecord::Migration[7.1] def change create_table :weathers do |t| t.date :date diff --git a/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb b/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb index 4dffa4ce..b368b756 100644 --- a/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb +++ b/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb @@ -1,4 +1,4 @@ -class AddPressureAndTemperatureSettingsToProfile < ActiveRecord::Migration[5.1] +class AddPressureAndTemperatureSettingsToProfile < ActiveRecord::Migration[7.1] def change add_column :profiles, :pressure_units, :integer, default: 0 add_column :profiles, :temperature_units, :integer, default: 0 diff --git a/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb b/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb index ae60d624..30293a2e 100644 --- a/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb +++ b/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb @@ -1,4 +1,4 @@ -class AddBetaTesterToProfile < ActiveRecord::Migration[5.1] +class AddBetaTesterToProfile < ActiveRecord::Migration[7.1] def change add_column :profiles, :beta_tester, :boolean, default: false end diff --git a/backend/db/migrate/20170504065043_create_crono_jobs.rb b/backend/db/migrate/20170504065043_create_crono_jobs.rb index 9b158ff9..96801cf9 100644 --- a/backend/db/migrate/20170504065043_create_crono_jobs.rb +++ b/backend/db/migrate/20170504065043_create_crono_jobs.rb @@ -1,4 +1,4 @@ -class CreateCronoJobs < ActiveRecord::Migration[5.1] +class CreateCronoJobs < ActiveRecord::Migration[7.1] def self.up create_table :crono_jobs do |t| t.string :job_id, null: false diff --git a/backend/db/migrate/20170508151200_add_notify_to_profiles.rb b/backend/db/migrate/20170508151200_add_notify_to_profiles.rb index d839b7c4..2f5463af 100644 --- a/backend/db/migrate/20170508151200_add_notify_to_profiles.rb +++ b/backend/db/migrate/20170508151200_add_notify_to_profiles.rb @@ -1,4 +1,4 @@ -class AddNotifyToProfiles < ActiveRecord::Migration[5.1] +class AddNotifyToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :notify, :boolean, default: true end diff --git a/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb b/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb index 3c68c73b..432ea6f8 100644 --- a/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb +++ b/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb @@ -1,4 +1,4 @@ -class AddNotifyTokenToProfiles < ActiveRecord::Migration[5.1] +class AddNotifyTokenToProfiles < ActiveRecord::Migration[7.1] def up add_column :profiles, :notify_token, :string Profile.find_each(batch_size: 500) do |profile| diff --git a/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb b/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb index 7335f2ea..a181ecc8 100644 --- a/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb +++ b/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb @@ -1,4 +1,4 @@ -class AddSlugNameToProfiles < ActiveRecord::Migration[5.1] +class AddSlugNameToProfiles < ActiveRecord::Migration[7.1] def up add_column :profiles, :slug_name, :string add_index :profiles, :slug_name diff --git a/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb b/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb index 7aaf8838..efe03622 100644 --- a/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb +++ b/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb @@ -1,4 +1,4 @@ -class AddNotifyTopPostsToProfile < ActiveRecord::Migration[5.1] +class AddNotifyTopPostsToProfile < ActiveRecord::Migration[7.1] def change add_column :profiles, :notify_top_posts, :boolean, default: true end diff --git a/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb b/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb index 6cf6805e..f63e049d 100644 --- a/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb +++ b/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb @@ -1,4 +1,4 @@ -class AddGlobalToFoodsAndTags < ActiveRecord::Migration[5.1] +class AddGlobalToFoodsAndTags < ActiveRecord::Migration[7.1] def change add_column :foods, :global, :boolean, default: true add_column :tags, :global, :boolean, default: true diff --git a/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb b/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb index c3576859..8a5deb05 100644 --- a/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb +++ b/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb @@ -1,4 +1,4 @@ -class AddTrackableUsageCountToTags < ActiveRecord::Migration[5.1] +class AddTrackableUsageCountToTags < ActiveRecord::Migration[7.1] def change add_column :tags, :trackable_usages_count, :integer, default: 0 end diff --git a/backend/db/migrate/20170731125044_create_user_tags.rb b/backend/db/migrate/20170731125044_create_user_tags.rb index bbc645af..9ab1283a 100644 --- a/backend/db/migrate/20170731125044_create_user_tags.rb +++ b/backend/db/migrate/20170731125044_create_user_tags.rb @@ -1,4 +1,4 @@ -class CreateUserTags < ActiveRecord::Migration[5.1] +class CreateUserTags < ActiveRecord::Migration[7.1] def change create_table :user_tags do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb b/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb index 339d510c..bd342cd8 100644 --- a/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb +++ b/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb @@ -1,4 +1,4 @@ -class AddTrackableAbilityToFoods < ActiveRecord::Migration[5.1] +class AddTrackableAbilityToFoods < ActiveRecord::Migration[7.1] def change add_column :foods, :trackable_usages_count, :integer, default: 0 diff --git a/backend/db/migrate/20170817154145_create_positions.rb b/backend/db/migrate/20170817154145_create_positions.rb index 9590f055..5d5cc72b 100644 --- a/backend/db/migrate/20170817154145_create_positions.rb +++ b/backend/db/migrate/20170817154145_create_positions.rb @@ -1,10 +1,10 @@ -class CreatePositions < ActiveRecord::Migration[5.1] +class CreatePositions < ActiveRecord::Migration[7.1] def change create_table :positions do |t| t.string :postal_code, null: false t.string :location_name, null: false t.decimal :latitude, {precision: 10, scale: 7} - t.decimal :longitude, {precision: 10, scale: 7} + #t.decimal :longitude, {precision: 10, scale: 7} end end end diff --git a/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb b/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb index 16327d81..7459c016 100644 --- a/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb +++ b/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb @@ -1,4 +1,4 @@ -class AddPositionReferenceToWeather < ActiveRecord::Migration[5.1] +class AddPositionReferenceToWeather < ActiveRecord::Migration[7.1] def change add_reference :weathers, :position, foreign_key: true end diff --git a/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb b/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb index 4b45ba95..d04d992c 100644 --- a/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb +++ b/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb @@ -1,4 +1,4 @@ -class AddCheckinReminderToProfiles < ActiveRecord::Migration[5.1] +class AddCheckinReminderToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :checkin_reminder, :boolean, default: false add_column :profiles, :checkin_reminder_at, :datetime diff --git a/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb b/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb index 6dc48776..51282b26 100644 --- a/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb +++ b/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb @@ -1,4 +1,4 @@ -class AddRejectedTypeToProfiles < ActiveRecord::Migration[5.1] +class AddRejectedTypeToProfiles < ActiveRecord::Migration[7.1] def change add_column :profiles, :rejected_type, :string end diff --git a/backend/lib/tasks/app.rake b/backend/lib/tasks/app.rake index 68485190..d2ab58c6 100644 --- a/backend/lib/tasks/app.rake +++ b/backend/lib/tasks/app.rake @@ -44,7 +44,7 @@ namespace :app do Rake::Task["db:create"].invoke Rake::Task["db:migrate"].invoke end - Rake::Task["db:fixtures:load"].invoke + #Rake::Task["db:schema:load"].invoke Rake::Task["db:seed"].invoke rescue ::PG::ObjectInUse => e puts "\n#{e.message}.".red diff --git a/backend/spec/factories/users.rb b/backend/spec/factories/users.rb index 781b3dd8..7439fe73 100644 --- a/backend/spec/factories/users.rb +++ b/backend/spec/factories/users.rb @@ -26,9 +26,22 @@ # FactoryBot.define do + + def initialize_profile + create_profile!( + checkin_reminder: true, + onboarding_step_id: "onboarding-personal", + most_recent_doses: {}, + most_recent_conditions_positions: {}, + most_recent_symptoms_positions: {}, + most_recent_treatments_positions: {} + ) + end + factory :user do sequence(:email) { |number| "user#{number}@example.com" } password { "password123" } password_confirmation { "password123" } + after(:create) { initialize_profile } end end From f00f7744e721f67afd82428789473caebe2100ad Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:00:48 +0300 Subject: [PATCH 2/5] Revert ActiveRecord::Migration class from [7.1] to [5.1] Reverted changing ActiveRecord::Migration class from [7.1] to [5.1] (this was done as part of the feature branch rebase on master) Also added lint fixes --- backend/db/migrate/20160101154821_create_extensions.rb | 2 +- backend/db/migrate/20160106154821_create_users.rb | 2 +- backend/db/migrate/20160119185831_create_profiles.rb | 2 +- backend/db/migrate/20160128112500_create_conditions.rb | 2 +- backend/db/migrate/20160128114341_create_user_conditions.rb | 2 +- backend/db/migrate/20160128191053_create_symptoms.rb | 2 +- backend/db/migrate/20160128191329_create_user_symptoms.rb | 2 +- backend/db/migrate/20160128210332_create_trackings.rb | 2 +- backend/db/migrate/20160129063945_create_treatments.rb | 2 +- backend/db/migrate/20160129064538_create_user_treatments.rb | 2 +- backend/db/migrate/20160211105611_create_tags.rb | 2 +- .../db/migrate/20160224141256_add_demographics_to_profiles.rb | 2 +- backend/db/migrate/20160404073700_enable_hstore_extension.rb | 2 +- .../20160404073731_add_most_recent_doses_to_profiles.rb | 2 +- backend/db/migrate/20160426222232_create_trackable_usages.rb | 2 +- .../db/migrate/20160427055217_add_trackable_usages_counts.rb | 2 +- .../db/migrate/20160608161002_add_screen_name_to_profile.rb | 2 +- .../20160711182546_add_most_recent_positions_to_profiles.rb | 2 +- backend/db/migrate/20161206135858_create_foods.rb | 2 +- ...4131805_add_long_desc_vector_index_on_food_translations.rb | 2 +- backend/db/migrate/20161216123757_create_weathers.rb | 2 +- ...090023_add_pressure_and_temperature_settings_to_profile.rb | 2 +- .../db/migrate/20170413144043_add_beta_tester_to_profile.rb | 2 +- backend/db/migrate/20170504065043_create_crono_jobs.rb | 2 +- backend/db/migrate/20170508151200_add_notify_to_profiles.rb | 2 +- .../db/migrate/20170509114220_add_notify_token_to_profiles.rb | 2 +- .../db/migrate/20170612160120_add_slug_name_to_profiles.rb | 2 +- .../migrate/20170717153650_add_notify_top_posts_to_profile.rb | 2 +- .../db/migrate/20170731083613_add_global_to_foods_and_tags.rb | 2 +- .../20170731123835_add_trackable_usage_count_to_tags.rb | 2 +- backend/db/migrate/20170731125044_create_user_tags.rb | 2 +- .../migrate/20170801124153_add_trackable_ability_to_foods.rb | 2 +- backend/db/migrate/20170817154145_create_positions.rb | 4 ++-- .../20170818085110_add_position_reference_to_weather.rb | 2 +- .../20170822122800_add_checkin_reminder_to_profiles.rb | 2 +- .../migrate/20171011142928_add_rejected_type_to_profiles.rb | 2 +- backend/lib/tasks/app.rake | 2 +- backend/spec/factories/users.rb | 1 - 38 files changed, 38 insertions(+), 39 deletions(-) diff --git a/backend/db/migrate/20160101154821_create_extensions.rb b/backend/db/migrate/20160101154821_create_extensions.rb index c25c1626..c892ad69 100644 --- a/backend/db/migrate/20160101154821_create_extensions.rb +++ b/backend/db/migrate/20160101154821_create_extensions.rb @@ -1,4 +1,4 @@ -class CreateExtensions < ActiveRecord::Migration[7.1] +class CreateExtensions < ActiveRecord::Migration[5.1] def change enable_extension "pg_trgm" end diff --git a/backend/db/migrate/20160106154821_create_users.rb b/backend/db/migrate/20160106154821_create_users.rb index 634dc33a..ca83a304 100644 --- a/backend/db/migrate/20160106154821_create_users.rb +++ b/backend/db/migrate/20160106154821_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration[7.1] +class CreateUsers < ActiveRecord::Migration[5.1] def change create_table :users do |t| ## Database authenticatable diff --git a/backend/db/migrate/20160119185831_create_profiles.rb b/backend/db/migrate/20160119185831_create_profiles.rb index eb3c5738..743760b6 100644 --- a/backend/db/migrate/20160119185831_create_profiles.rb +++ b/backend/db/migrate/20160119185831_create_profiles.rb @@ -1,4 +1,4 @@ -class CreateProfiles < ActiveRecord::Migration[7.1] +class CreateProfiles < ActiveRecord::Migration[5.1] def change create_table :profiles do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128112500_create_conditions.rb b/backend/db/migrate/20160128112500_create_conditions.rb index 3f5f83e5..5d41a79e 100644 --- a/backend/db/migrate/20160128112500_create_conditions.rb +++ b/backend/db/migrate/20160128112500_create_conditions.rb @@ -1,4 +1,4 @@ -class CreateConditions < ActiveRecord::Migration[7.1] +class CreateConditions < ActiveRecord::Migration[5.1] def up create_table :conditions do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160128114341_create_user_conditions.rb b/backend/db/migrate/20160128114341_create_user_conditions.rb index bd7a9b71..97e41ee7 100644 --- a/backend/db/migrate/20160128114341_create_user_conditions.rb +++ b/backend/db/migrate/20160128114341_create_user_conditions.rb @@ -1,4 +1,4 @@ -class CreateUserConditions < ActiveRecord::Migration[7.1] +class CreateUserConditions < ActiveRecord::Migration[5.1] def change create_table :user_conditions do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128191053_create_symptoms.rb b/backend/db/migrate/20160128191053_create_symptoms.rb index d7c8a045..74b70e35 100644 --- a/backend/db/migrate/20160128191053_create_symptoms.rb +++ b/backend/db/migrate/20160128191053_create_symptoms.rb @@ -1,4 +1,4 @@ -class CreateSymptoms < ActiveRecord::Migration[7.1] +class CreateSymptoms < ActiveRecord::Migration[5.1] def up create_table :symptoms do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160128191329_create_user_symptoms.rb b/backend/db/migrate/20160128191329_create_user_symptoms.rb index 3c4f4cca..449c5ad9 100644 --- a/backend/db/migrate/20160128191329_create_user_symptoms.rb +++ b/backend/db/migrate/20160128191329_create_user_symptoms.rb @@ -1,4 +1,4 @@ -class CreateUserSymptoms < ActiveRecord::Migration[7.1] +class CreateUserSymptoms < ActiveRecord::Migration[5.1] def change create_table :user_symptoms do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160128210332_create_trackings.rb b/backend/db/migrate/20160128210332_create_trackings.rb index 58864383..2131bd01 100644 --- a/backend/db/migrate/20160128210332_create_trackings.rb +++ b/backend/db/migrate/20160128210332_create_trackings.rb @@ -1,4 +1,4 @@ -class CreateTrackings < ActiveRecord::Migration[7.1] +class CreateTrackings < ActiveRecord::Migration[5.1] def change create_table :trackings do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160129063945_create_treatments.rb b/backend/db/migrate/20160129063945_create_treatments.rb index 0ec35c66..23c24585 100644 --- a/backend/db/migrate/20160129063945_create_treatments.rb +++ b/backend/db/migrate/20160129063945_create_treatments.rb @@ -1,4 +1,4 @@ -class CreateTreatments < ActiveRecord::Migration[7.1] +class CreateTreatments < ActiveRecord::Migration[5.1] def up create_table :treatments do |t| t.boolean :global, default: true diff --git a/backend/db/migrate/20160129064538_create_user_treatments.rb b/backend/db/migrate/20160129064538_create_user_treatments.rb index 3e81ec25..eddbe91c 100644 --- a/backend/db/migrate/20160129064538_create_user_treatments.rb +++ b/backend/db/migrate/20160129064538_create_user_treatments.rb @@ -1,4 +1,4 @@ -class CreateUserTreatments < ActiveRecord::Migration[7.1] +class CreateUserTreatments < ActiveRecord::Migration[5.1] def change create_table :user_treatments do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160211105611_create_tags.rb b/backend/db/migrate/20160211105611_create_tags.rb index 60f02d85..6471b26d 100644 --- a/backend/db/migrate/20160211105611_create_tags.rb +++ b/backend/db/migrate/20160211105611_create_tags.rb @@ -1,4 +1,4 @@ -class CreateTags < ActiveRecord::Migration[7.1] +class CreateTags < ActiveRecord::Migration[5.1] def up create_table :tags do |t| t.timestamps null: false diff --git a/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb b/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb index 8661a676..b5200be8 100644 --- a/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb +++ b/backend/db/migrate/20160224141256_add_demographics_to_profiles.rb @@ -1,4 +1,4 @@ -class AddDemographicsToProfiles < ActiveRecord::Migration[7.1] +class AddDemographicsToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :ethnicity_ids_string, :string add_column :profiles, :day_habit_id, :string diff --git a/backend/db/migrate/20160404073700_enable_hstore_extension.rb b/backend/db/migrate/20160404073700_enable_hstore_extension.rb index 32398fa4..1b1f569f 100644 --- a/backend/db/migrate/20160404073700_enable_hstore_extension.rb +++ b/backend/db/migrate/20160404073700_enable_hstore_extension.rb @@ -1,4 +1,4 @@ -class EnableHstoreExtension < ActiveRecord::Migration[7.1] +class EnableHstoreExtension < ActiveRecord::Migration[5.1] def change enable_extension "hstore" end diff --git a/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb b/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb index db76ead2..e4373a80 100644 --- a/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb +++ b/backend/db/migrate/20160404073731_add_most_recent_doses_to_profiles.rb @@ -1,4 +1,4 @@ -class AddMostRecentDosesToProfiles < ActiveRecord::Migration[7.1] +class AddMostRecentDosesToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :most_recent_doses, :hstore end diff --git a/backend/db/migrate/20160426222232_create_trackable_usages.rb b/backend/db/migrate/20160426222232_create_trackable_usages.rb index dbf96421..eebe8259 100644 --- a/backend/db/migrate/20160426222232_create_trackable_usages.rb +++ b/backend/db/migrate/20160426222232_create_trackable_usages.rb @@ -1,4 +1,4 @@ -class CreateTrackableUsages < ActiveRecord::Migration[7.1] +class CreateTrackableUsages < ActiveRecord::Migration[5.1] def change create_table :trackable_usages do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb b/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb index 8f4ce169..7bddd1ff 100644 --- a/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb +++ b/backend/db/migrate/20160427055217_add_trackable_usages_counts.rb @@ -1,4 +1,4 @@ -class AddTrackableUsagesCounts < ActiveRecord::Migration[7.1] +class AddTrackableUsagesCounts < ActiveRecord::Migration[5.1] def change add_column :conditions, :trackable_usages_count, :integer, default: 0 add_column :symptoms, :trackable_usages_count, :integer, default: 0 diff --git a/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb b/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb index ae144831..f09f1361 100644 --- a/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb +++ b/backend/db/migrate/20160608161002_add_screen_name_to_profile.rb @@ -1,4 +1,4 @@ -class AddScreenNameToProfile < ActiveRecord::Migration[7.1] +class AddScreenNameToProfile < ActiveRecord::Migration[5.1] def change add_column :profiles, :screen_name, :string end diff --git a/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb b/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb index a2384a66..bf7a523d 100644 --- a/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb +++ b/backend/db/migrate/20160711182546_add_most_recent_positions_to_profiles.rb @@ -1,4 +1,4 @@ -class AddMostRecentPositionsToProfiles < ActiveRecord::Migration[7.1] +class AddMostRecentPositionsToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :most_recent_conditions_positions, :hstore add_column :profiles, :most_recent_symptoms_positions, :hstore diff --git a/backend/db/migrate/20161206135858_create_foods.rb b/backend/db/migrate/20161206135858_create_foods.rb index c733be7d..a58652dc 100644 --- a/backend/db/migrate/20161206135858_create_foods.rb +++ b/backend/db/migrate/20161206135858_create_foods.rb @@ -1,4 +1,4 @@ -class CreateFoods < ActiveRecord::Migration[7.1] +class CreateFoods < ActiveRecord::Migration[5.1] def change create_table :foods do |t| t.string :ndb_no diff --git a/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb b/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb index 952f4339..27faa86e 100644 --- a/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb +++ b/backend/db/migrate/20161214131805_add_long_desc_vector_index_on_food_translations.rb @@ -1,4 +1,4 @@ -class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration[7.1] +class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration[5.1] disable_ddl_transaction! def up diff --git a/backend/db/migrate/20161216123757_create_weathers.rb b/backend/db/migrate/20161216123757_create_weathers.rb index db80dd5c..2c3ff0cb 100644 --- a/backend/db/migrate/20161216123757_create_weathers.rb +++ b/backend/db/migrate/20161216123757_create_weathers.rb @@ -1,4 +1,4 @@ -class CreateWeathers < ActiveRecord::Migration[7.1] +class CreateWeathers < ActiveRecord::Migration[5.1] def change create_table :weathers do |t| t.date :date diff --git a/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb b/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb index b368b756..4dffa4ce 100644 --- a/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb +++ b/backend/db/migrate/20161230090023_add_pressure_and_temperature_settings_to_profile.rb @@ -1,4 +1,4 @@ -class AddPressureAndTemperatureSettingsToProfile < ActiveRecord::Migration[7.1] +class AddPressureAndTemperatureSettingsToProfile < ActiveRecord::Migration[5.1] def change add_column :profiles, :pressure_units, :integer, default: 0 add_column :profiles, :temperature_units, :integer, default: 0 diff --git a/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb b/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb index 30293a2e..ae60d624 100644 --- a/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb +++ b/backend/db/migrate/20170413144043_add_beta_tester_to_profile.rb @@ -1,4 +1,4 @@ -class AddBetaTesterToProfile < ActiveRecord::Migration[7.1] +class AddBetaTesterToProfile < ActiveRecord::Migration[5.1] def change add_column :profiles, :beta_tester, :boolean, default: false end diff --git a/backend/db/migrate/20170504065043_create_crono_jobs.rb b/backend/db/migrate/20170504065043_create_crono_jobs.rb index 96801cf9..9b158ff9 100644 --- a/backend/db/migrate/20170504065043_create_crono_jobs.rb +++ b/backend/db/migrate/20170504065043_create_crono_jobs.rb @@ -1,4 +1,4 @@ -class CreateCronoJobs < ActiveRecord::Migration[7.1] +class CreateCronoJobs < ActiveRecord::Migration[5.1] def self.up create_table :crono_jobs do |t| t.string :job_id, null: false diff --git a/backend/db/migrate/20170508151200_add_notify_to_profiles.rb b/backend/db/migrate/20170508151200_add_notify_to_profiles.rb index 2f5463af..d839b7c4 100644 --- a/backend/db/migrate/20170508151200_add_notify_to_profiles.rb +++ b/backend/db/migrate/20170508151200_add_notify_to_profiles.rb @@ -1,4 +1,4 @@ -class AddNotifyToProfiles < ActiveRecord::Migration[7.1] +class AddNotifyToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :notify, :boolean, default: true end diff --git a/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb b/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb index 432ea6f8..3c68c73b 100644 --- a/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb +++ b/backend/db/migrate/20170509114220_add_notify_token_to_profiles.rb @@ -1,4 +1,4 @@ -class AddNotifyTokenToProfiles < ActiveRecord::Migration[7.1] +class AddNotifyTokenToProfiles < ActiveRecord::Migration[5.1] def up add_column :profiles, :notify_token, :string Profile.find_each(batch_size: 500) do |profile| diff --git a/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb b/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb index a181ecc8..7335f2ea 100644 --- a/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb +++ b/backend/db/migrate/20170612160120_add_slug_name_to_profiles.rb @@ -1,4 +1,4 @@ -class AddSlugNameToProfiles < ActiveRecord::Migration[7.1] +class AddSlugNameToProfiles < ActiveRecord::Migration[5.1] def up add_column :profiles, :slug_name, :string add_index :profiles, :slug_name diff --git a/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb b/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb index efe03622..7aaf8838 100644 --- a/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb +++ b/backend/db/migrate/20170717153650_add_notify_top_posts_to_profile.rb @@ -1,4 +1,4 @@ -class AddNotifyTopPostsToProfile < ActiveRecord::Migration[7.1] +class AddNotifyTopPostsToProfile < ActiveRecord::Migration[5.1] def change add_column :profiles, :notify_top_posts, :boolean, default: true end diff --git a/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb b/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb index f63e049d..6cf6805e 100644 --- a/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb +++ b/backend/db/migrate/20170731083613_add_global_to_foods_and_tags.rb @@ -1,4 +1,4 @@ -class AddGlobalToFoodsAndTags < ActiveRecord::Migration[7.1] +class AddGlobalToFoodsAndTags < ActiveRecord::Migration[5.1] def change add_column :foods, :global, :boolean, default: true add_column :tags, :global, :boolean, default: true diff --git a/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb b/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb index 8a5deb05..c3576859 100644 --- a/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb +++ b/backend/db/migrate/20170731123835_add_trackable_usage_count_to_tags.rb @@ -1,4 +1,4 @@ -class AddTrackableUsageCountToTags < ActiveRecord::Migration[7.1] +class AddTrackableUsageCountToTags < ActiveRecord::Migration[5.1] def change add_column :tags, :trackable_usages_count, :integer, default: 0 end diff --git a/backend/db/migrate/20170731125044_create_user_tags.rb b/backend/db/migrate/20170731125044_create_user_tags.rb index 9ab1283a..bbc645af 100644 --- a/backend/db/migrate/20170731125044_create_user_tags.rb +++ b/backend/db/migrate/20170731125044_create_user_tags.rb @@ -1,4 +1,4 @@ -class CreateUserTags < ActiveRecord::Migration[7.1] +class CreateUserTags < ActiveRecord::Migration[5.1] def change create_table :user_tags do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb b/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb index bd342cd8..339d510c 100644 --- a/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb +++ b/backend/db/migrate/20170801124153_add_trackable_ability_to_foods.rb @@ -1,4 +1,4 @@ -class AddTrackableAbilityToFoods < ActiveRecord::Migration[7.1] +class AddTrackableAbilityToFoods < ActiveRecord::Migration[5.1] def change add_column :foods, :trackable_usages_count, :integer, default: 0 diff --git a/backend/db/migrate/20170817154145_create_positions.rb b/backend/db/migrate/20170817154145_create_positions.rb index 5d5cc72b..5e424e53 100644 --- a/backend/db/migrate/20170817154145_create_positions.rb +++ b/backend/db/migrate/20170817154145_create_positions.rb @@ -1,10 +1,10 @@ -class CreatePositions < ActiveRecord::Migration[7.1] +class CreatePositions < ActiveRecord::Migration[5.1] def change create_table :positions do |t| t.string :postal_code, null: false t.string :location_name, null: false t.decimal :latitude, {precision: 10, scale: 7} - #t.decimal :longitude, {precision: 10, scale: 7} + # t.decimal :longitude, {precision: 10, scale: 7} end end end diff --git a/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb b/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb index 7459c016..16327d81 100644 --- a/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb +++ b/backend/db/migrate/20170818085110_add_position_reference_to_weather.rb @@ -1,4 +1,4 @@ -class AddPositionReferenceToWeather < ActiveRecord::Migration[7.1] +class AddPositionReferenceToWeather < ActiveRecord::Migration[5.1] def change add_reference :weathers, :position, foreign_key: true end diff --git a/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb b/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb index d04d992c..4b45ba95 100644 --- a/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb +++ b/backend/db/migrate/20170822122800_add_checkin_reminder_to_profiles.rb @@ -1,4 +1,4 @@ -class AddCheckinReminderToProfiles < ActiveRecord::Migration[7.1] +class AddCheckinReminderToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :checkin_reminder, :boolean, default: false add_column :profiles, :checkin_reminder_at, :datetime diff --git a/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb b/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb index 51282b26..6dc48776 100644 --- a/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb +++ b/backend/db/migrate/20171011142928_add_rejected_type_to_profiles.rb @@ -1,4 +1,4 @@ -class AddRejectedTypeToProfiles < ActiveRecord::Migration[7.1] +class AddRejectedTypeToProfiles < ActiveRecord::Migration[5.1] def change add_column :profiles, :rejected_type, :string end diff --git a/backend/lib/tasks/app.rake b/backend/lib/tasks/app.rake index d2ab58c6..4afafa12 100644 --- a/backend/lib/tasks/app.rake +++ b/backend/lib/tasks/app.rake @@ -44,7 +44,7 @@ namespace :app do Rake::Task["db:create"].invoke Rake::Task["db:migrate"].invoke end - #Rake::Task["db:schema:load"].invoke + # Rake::Task["db:schema:load"].invoke Rake::Task["db:seed"].invoke rescue ::PG::ObjectInUse => e puts "\n#{e.message}.".red diff --git a/backend/spec/factories/users.rb b/backend/spec/factories/users.rb index 7439fe73..aa09299f 100644 --- a/backend/spec/factories/users.rb +++ b/backend/spec/factories/users.rb @@ -26,7 +26,6 @@ # FactoryBot.define do - def initialize_profile create_profile!( checkin_reminder: true, From c103d876d90994be007cc8a880b64e7b48f1358b Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:10:48 +0300 Subject: [PATCH 3/5] Revert change to fixtures task Reverted change to fixtures task since going by https://github.com/rubyforgood/Flaredown/pull/789 the original task (`db:structure:load`) has been changed to load fixtures instead. --- backend/lib/tasks/app.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/lib/tasks/app.rake b/backend/lib/tasks/app.rake index 4afafa12..68485190 100644 --- a/backend/lib/tasks/app.rake +++ b/backend/lib/tasks/app.rake @@ -44,7 +44,7 @@ namespace :app do Rake::Task["db:create"].invoke Rake::Task["db:migrate"].invoke end - # Rake::Task["db:schema:load"].invoke + Rake::Task["db:fixtures:load"].invoke Rake::Task["db:seed"].invoke rescue ::PG::ObjectInUse => e puts "\n#{e.message}.".red From 235a49a58de3b2842e8d86c8300b5889844c0562 Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:15:17 +0300 Subject: [PATCH 4/5] Remove `initialize_profile`, `after_create` call Removed the `initialize_profile` method and the `after_create` call that uses it since the method may have unforeseen side effects on test setup. --- backend/spec/factories/users.rb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/backend/spec/factories/users.rb b/backend/spec/factories/users.rb index aa09299f..781b3dd8 100644 --- a/backend/spec/factories/users.rb +++ b/backend/spec/factories/users.rb @@ -26,21 +26,9 @@ # FactoryBot.define do - def initialize_profile - create_profile!( - checkin_reminder: true, - onboarding_step_id: "onboarding-personal", - most_recent_doses: {}, - most_recent_conditions_positions: {}, - most_recent_symptoms_positions: {}, - most_recent_treatments_positions: {} - ) - end - factory :user do sequence(:email) { |number| "user#{number}@example.com" } password { "password123" } password_confirmation { "password123" } - after(:create) { initialize_profile } end end From 17756c8eaa0827173e421c39020276cbf1e3085b Mon Sep 17 00:00:00 2001 From: Leni Kadali <52788034+lenikadali@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:42:18 +0300 Subject: [PATCH 5/5] Revert removal of longitude column --- backend/db/migrate/20170817154145_create_positions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/db/migrate/20170817154145_create_positions.rb b/backend/db/migrate/20170817154145_create_positions.rb index 5e424e53..9590f055 100644 --- a/backend/db/migrate/20170817154145_create_positions.rb +++ b/backend/db/migrate/20170817154145_create_positions.rb @@ -4,7 +4,7 @@ def change t.string :postal_code, null: false t.string :location_name, null: false t.decimal :latitude, {precision: 10, scale: 7} - # t.decimal :longitude, {precision: 10, scale: 7} + t.decimal :longitude, {precision: 10, scale: 7} end end end