Skip to content

Commit

Permalink
Merge branch 'migrations' of github.com:fiveNinePlusR/pbm
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanTG committed Dec 7, 2024
2 parents 61aafdf + 207ed01 commit 0e4a7eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ default: &default

development:
<<: *default
database: pbm_dev
database: <%= ENV.fetch("DATABASE", 'pbm_dev') %>
host: localhost

test:
<<: *default
database: pbm_test
database: <%= ENV.fetch("DATABASE", 'pbm_test') %>

staging:
url: <%= ENV["DATABASE_URL"] %>
Expand Down
10 changes: 5 additions & 5 deletions db/migrate/20241126054618_add_submission_counts_to_users.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class AddSubmissionCountsToUsers < ActiveRecord::Migration[7.2]
def change
add_column :users, :num_machines_added, :integer
add_column :users, :num_machines_removed, :integer
add_column :users, :num_locations_suggested, :integer
add_column :users, :num_lmx_comments_left, :integer
add_column :users, :num_msx_scores_added, :integer
add_column :users, :num_machines_added, :integer, default: 0
add_column :users, :num_machines_removed, :integer, default: 0
add_column :users, :num_locations_suggested, :integer, default: 0
add_column :users, :num_lmx_comments_left, :integer, default: 0
add_column :users, :num_msx_scores_added, :integer, default: 0
end
end
12 changes: 6 additions & 6 deletions db/migrate/20241128052830_fix_users_table_defaults.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class FixUsersTableDefaults < ActiveRecord::Migration[7.2]
def change
change_column_default :users, :num_machines_added, default: 0
change_column_default :users, :num_machines_removed, default: 0
change_column_default :users, :num_locations_suggested, default: 0
change_column_default :users, :num_lmx_comments_left, default: 0
change_column_default :users, :num_msx_scores_added, default: 0
change_column_default :users, :user_submissions_count, default: 0
change_column_default :users, :num_machines_added, from: nil, to: 0
change_column_default :users, :num_machines_removed, from: nil, to: 0
change_column_default :users, :num_locations_suggested, from: nil, to: 0
change_column_default :users, :num_lmx_comments_left, from: nil, to: 0
change_column_default :users, :num_msx_scores_added, from: nil, to: 0
change_column_default :users, :user_submissions_count, from: nil, to: 0
end
end

0 comments on commit 0e4a7eb

Please sign in to comment.