From d5327a81d8e63daf1d10b0fdf48c665ddce1fbbd Mon Sep 17 00:00:00 2001 From: Peter Cho Date: Sat, 8 Nov 2025 15:32:36 +1300 Subject: [PATCH] Fix setting up the dev application from scratch In trying to resolve the postgres upgrade warning from our third party vendor, I had difficulty setting up the app locally on my M1 mac. This PR attempts to unblock the dev set up so I can try and proceed to testing whether I can upgrade the app to use a later version of postgres (in a separate PR). * Updated all migrations to use the new syntax to include version numbers. This was preventing me from running all the migrations from scratch for my dev environment and the tests. * Updated the database schema. * Run migrations when seeding the database. Database did not install tables for the seed data to fill. * Use environment variable to get the postgres username for my local machine. Should default to the original value. (Since using my homebrewed postgres installtion uses my account's username by default. --- backend/config/database.yml | 2 +- backend/config/environments/production.rb | 2 +- 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 +- ...14131805_add_long_desc_vector_index_on_food_translations.rb | 2 +- backend/db/migrate/20161216123757_create_weathers.rb | 2 +- ...0090023_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 +- backend/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 | 2 +- .../20170818085110_add_position_reference_to_weather.rb | 2 +- .../migrate/20170822122800_add_checkin_reminder_to_profiles.rb | 2 +- .../db/migrate/20171011142928_add_rejected_type_to_profiles.rb | 2 +- backend/lib/tasks/app.rake | 3 ++- 39 files changed, 40 insertions(+), 39 deletions(-) diff --git a/backend/config/database.yml b/backend/config/database.yml index 42fe57ac5..976be1ddf 100644 --- a/backend/config/database.yml +++ b/backend/config/database.yml @@ -3,7 +3,7 @@ default: &default encoding: unicode host: <%= ENV.fetch('PG_DATABASE_HOST') { 'localhost' } %> database: flaredown_development - username: postgres + username: <%= ENV.fetch('PG_DATABASE_USERNAME') { 'postgres' } %> password: password pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 diff --git a/backend/config/environments/production.rb b/backend/config/environments/production.rb index ab43a8d0a..762a2dce0 100644 --- a/backend/config/environments/production.rb +++ b/backend/config/environments/production.rb @@ -44,7 +44,7 @@ config.force_ssl = true # Log to STDOUT by default - config.logger = ActiveSupport::Logger.new(STDOUT) + config.logger = ActiveSupport::Logger.new($stdout) .tap { |logger| logger.formatter = ::Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } diff --git a/backend/db/migrate/20160101154821_create_extensions.rb b/backend/db/migrate/20160101154821_create_extensions.rb index a26c2e850..c892ad693 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 +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 6d3d399f4..ca83a304c 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 +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 7988fbe21..743760b69 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 +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 e203d6652..5d41a79e6 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 +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 05483dd25..97e41ee75 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 +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 721fbba7a..74b70e354 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 +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 86cb38476..449c5ad99 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 +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 64b74d57d..2131bd011 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 +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 766cc3427..23c245857 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 +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 a2d0e6197..eddbe91cd 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 +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 f3b7eca6f..6471b26d7 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 +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 900bca086..b5200be87 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 +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 a0ffdf346..1b1f569f1 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 +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 e3d115319..e4373a804 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 +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 523f30580..eebe8259b 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 +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 44f0df3d6..7bddd1ffa 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 +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 8238c3810..f09f1361b 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 +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 108e31557..bf7a523d7 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 +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 dc489f995..a58652dce 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 +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 63b4b056f..27faa86e8 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 +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 9deb73278..2c3ff0cbd 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 +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 29cac753a..4dffa4ce4 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 +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 8d9eb6bbd..ae60d6247 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 +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 25173953b..9b158ff90 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 +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 6ab0b388a..d839b7c47 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 +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 8182908f3..3c68c73be 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 +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 c27b9c525..7335f2eaa 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 +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 9a20cf0c5..7aaf8838e 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 +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 f63e53f5f..6cf6805ea 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 +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 dc04b752c..c3576859c 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 +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 374c42b48..bbc645afa 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 +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 cdf1e5b49..339d510ca 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 +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 001b98d4d..9590f0552 100644 --- a/backend/db/migrate/20170817154145_create_positions.rb +++ b/backend/db/migrate/20170817154145_create_positions.rb @@ -1,4 +1,4 @@ -class CreatePositions < ActiveRecord::Migration +class CreatePositions < ActiveRecord::Migration[5.1] def change create_table :positions do |t| t.string :postal_code, null: false 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 873558b82..16327d819 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 +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 61d1f0ea0..4b45ba952 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 +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 f4a8bdc5b..6dc487765 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 +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 8270c6c61..68485190e 100644 --- a/backend/lib/tasks/app.rake +++ b/backend/lib/tasks/app.rake @@ -42,8 +42,9 @@ namespace :app do if Rails.env.development? Rake::Task["db:drop"].invoke Rake::Task["db:create"].invoke + Rake::Task["db:migrate"].invoke end - Rake::Task["db:structure:load"].invoke + Rake::Task["db:fixtures:load"].invoke Rake::Task["db:seed"].invoke rescue ::PG::ObjectInUse => e puts "\n#{e.message}.".red