Skip to content

Commit 06d8316

Browse files
authored
Fix setting up the dev application from scratch (#789)
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.
1 parent a5dae4e commit 06d8316

File tree

39 files changed

+40
-39
lines changed

39 files changed

+40
-39
lines changed

backend/config/database.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default: &default
33
encoding: unicode
44
host: <%= ENV.fetch('PG_DATABASE_HOST') { 'localhost' } %>
55
database: flaredown_development
6-
username: postgres
6+
username: <%= ENV.fetch('PG_DATABASE_USERNAME') { 'postgres' } %>
77
password: password
88
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
99
timeout: 5000

backend/config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
config.force_ssl = true
4545

4646
# Log to STDOUT by default
47-
config.logger = ActiveSupport::Logger.new(STDOUT)
47+
config.logger = ActiveSupport::Logger.new($stdout)
4848
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
4949
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
5050

backend/db/migrate/20160101154821_create_extensions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateExtensions < ActiveRecord::Migration
1+
class CreateExtensions < ActiveRecord::Migration[5.1]
22
def change
33
enable_extension "pg_trgm"
44
end

backend/db/migrate/20160106154821_create_users.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateUsers < ActiveRecord::Migration
1+
class CreateUsers < ActiveRecord::Migration[5.1]
22
def change
33
create_table :users do |t|
44
## Database authenticatable

backend/db/migrate/20160119185831_create_profiles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateProfiles < ActiveRecord::Migration
1+
class CreateProfiles < ActiveRecord::Migration[5.1]
22
def change
33
create_table :profiles do |t|
44
t.belongs_to :user, index: true, foreign_key: true

backend/db/migrate/20160128112500_create_conditions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateConditions < ActiveRecord::Migration
1+
class CreateConditions < ActiveRecord::Migration[5.1]
22
def up
33
create_table :conditions do |t|
44
t.boolean :global, default: true

backend/db/migrate/20160128114341_create_user_conditions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateUserConditions < ActiveRecord::Migration
1+
class CreateUserConditions < ActiveRecord::Migration[5.1]
22
def change
33
create_table :user_conditions do |t|
44
t.belongs_to :user, index: true, foreign_key: true

backend/db/migrate/20160128191053_create_symptoms.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateSymptoms < ActiveRecord::Migration
1+
class CreateSymptoms < ActiveRecord::Migration[5.1]
22
def up
33
create_table :symptoms do |t|
44
t.boolean :global, default: true

backend/db/migrate/20160128191329_create_user_symptoms.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateUserSymptoms < ActiveRecord::Migration
1+
class CreateUserSymptoms < ActiveRecord::Migration[5.1]
22
def change
33
create_table :user_symptoms do |t|
44
t.belongs_to :user, index: true, foreign_key: true

backend/db/migrate/20160128210332_create_trackings.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateTrackings < ActiveRecord::Migration
1+
class CreateTrackings < ActiveRecord::Migration[5.1]
22
def change
33
create_table :trackings do |t|
44
t.belongs_to :user, index: true, foreign_key: true

0 commit comments

Comments
 (0)