Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160101154821_create_extensions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateExtensions < ActiveRecord::Migration
class CreateExtensions < ActiveRecord::Migration[5.1]
def change
enable_extension "pg_trgm"
end
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160106154821_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateUsers < ActiveRecord::Migration
class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
## Database authenticatable
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160119185831_create_profiles.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160128112500_create_conditions.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160128191053_create_symptoms.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160128191329_create_user_symptoms.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160128210332_create_trackings.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160129063945_create_treatments.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20160211105611_create_tags.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class EnableHstoreExtension < ActiveRecord::Migration
class EnableHstoreExtension < ActiveRecord::Migration[5.1]
def change
enable_extension "hstore"
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddMostRecentDosesToProfiles < ActiveRecord::Migration
class AddMostRecentDosesToProfiles < ActiveRecord::Migration[5.1]
def change
add_column :profiles, :most_recent_doses, :hstore
end
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddScreenNameToProfile < ActiveRecord::Migration
class AddScreenNameToProfile < ActiveRecord::Migration[5.1]
def change
add_column :profiles, :screen_name, :string
end
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20161206135858_create_foods.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration
class AddLongDescVectorIndexOnFoodTranslations < ActiveRecord::Migration[5.1]
disable_ddl_transaction!

def up
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20161216123757_create_weathers.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateWeathers < ActiveRecord::Migration
class CreateWeathers < ActiveRecord::Migration[5.1]
def change
create_table :weathers do |t|
t.date :date
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20170504065043_create_crono_jobs.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddNotifyToProfiles < ActiveRecord::Migration
class AddNotifyToProfiles < ActiveRecord::Migration[5.1]
def change
add_column :profiles, :notify, :boolean, default: true
end
Expand Down
Original file line number Diff line number Diff line change
@@ -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|
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20170731125044_create_user_tags.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion backend/db/migrate/20170817154145_create_positions.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddPositionReferenceToWeather < ActiveRecord::Migration
class AddPositionReferenceToWeather < ActiveRecord::Migration[5.1]
def change
add_reference :weathers, :position, foreign_key: true
end
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddRejectedTypeToProfiles < ActiveRecord::Migration
class AddRejectedTypeToProfiles < ActiveRecord::Migration[5.1]
def change
add_column :profiles, :rejected_type, :string
end
Expand Down
3 changes: 2 additions & 1 deletion backend/lib/tasks/app.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Copilot AI Nov 12, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from db:structure:load to db:fixtures:load appears to be incorrect. The db:fixtures:load task is used to load test fixtures (static test data), not to set up the database schema.

The original code used db:structure:load to load the schema from structure.sql, which is appropriate for Rails applications configured to use SQL schema format. The new code runs db:migrate (which is good for development), but then calls db:fixtures:load which likely does nothing or loads unintended test data.

Since there's no db/fixtures/ directory with YAML fixture files, this task probably has no effect, but it's still semantically incorrect. If the intent is to run migrations in development, the db:structure:load line should likely be removed entirely for development environments, or kept for other environments where migrations haven't been run yet.

Copilot uses AI. Check for mistakes.
Rake::Task["db:seed"].invoke
rescue ::PG::ObjectInUse => e
puts "\n#{e.message}.".red
Expand Down
Loading