-
Notifications
You must be signed in to change notification settings - Fork 17
Change ActiveRecord::Migration to ActiveRecord::Migration[7.1] #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
class CreatePositions < ActiveRecord::Migration | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:schema:load"].invoke | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to comment out the The error I got when I tried to run psql:/app/db/structure.sql:60: ERROR: relation "ar_internal_metadata" already exists
bin/rails aborted!
failed to execute:
psql --set ON_ERROR_STOP=1 --quiet --no-psqlrc --output /dev/null --file /app/db/structure.sql flaredown_development
Please check the output above for any errors and make sure that `psql` is installed in your PATH and has proper permissions.
/app/lib/tasks/app.rake:47:in `build_database'
/app/lib/tasks/app.rake:32:in `setup'
/app/lib/tasks/app.rake:4:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace) It seems There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious if it would work as intended if we put the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't know since I was running this for development setup purposes 🙃 |
||
Rake::Task["db:seed"].invoke | ||
rescue ::PG::ObjectInUse => e | ||
puts "\n#{e.message}.".red | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 } | ||
Comment on lines
+30
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified the Done.
bin/rails aborted!
NameError: undefined local variable or method `init_profile' for #<FactoryBot::SyntaxRunner:0x00007eaac2e3c560> (NameError)
after(:create) { init_profile }
^^^^^^^^^^^^
Did you mean? initialize
/app/spec/factories/users.rb:45:in `block (3 levels) in <top (required)>'
/app/db/seeds/development/users.seeds.rb:4:in `block in evaluate'
/app/db/seeds/development/users.seeds.rb:3:in `each'
/app/db/seeds/development/users.seeds.rb:3:in `evaluate'
Tasks: TOP => db:seed => db:seed:development => db:seed:development:users
(See full trace by running task with --trace) |
||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this causing a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably the migration was failing to go through with the field as is. Can check and confirm.