Skip to content
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

EL-1756: Create new field in the completed user journeys table to record EE result #1591

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 5 additions & 4 deletions app/models/completed_user_journey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class CompletedUserJourney < ApplicationRecord
# partner boolean false false
# person_over_60 boolean false false
# passported boolean false false
# main_dwelling_owned boolean false false
# vehicle_owned boolean false false
# smod_assets boolean false false
# main_dwelling_owned boolean true false
# vehicle_owned boolean true false
# smod_assets boolean true false
# outcome character varying false false
# capital_contribution boolean false false
# capital_contribution boolean true false
# income_contribution boolean false false
# completed date true false
# form_downloaded boolean true false false
Expand All @@ -25,5 +25,6 @@ class CompletedUserJourney < ApplicationRecord
# client_age character varying true false
# session jsonb true false
# office_code character varying true false
# early_result_type character varying true false
#
#------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AmmenedCompletedUserJourneyForEarlyResultType < ActiveRecord::Migration[7.1]
Copy link
Contributor

Choose a reason for hiding this comment

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

you've got a typo here in the class name - but on another point, normally with migration file naming, the standard is to use the present tense, and use words like 'add', 'create', 'remove' etc (you can take a look at the older migrations for some good examples - something like AddEarlyResultTypeToCompletedUserJourneys)

Also you are probably already aware of this but just in case - to generate these files you can run some commands, which give you a nice file template to work with i.e. rails generate migration ChangeCompletedUserJourneys.

Other than the naming, looks good!

def change
change_table :completed_user_journeys, bulk: true do |t|
t.column :early_result_type, :string, null: true
t.change_null :main_dwelling_owned, true
t.change_null :vehicle_owned, true
t.change_null :smod_assets, true
t.change_null :capital_contribution, true
end
end
end
11 changes: 6 additions & 5 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2024_07_15_104344) do
ActiveRecord::Schema[7.1].define(version: 2024_10_09_105601) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -93,11 +93,11 @@
t.boolean "partner", null: false
t.boolean "person_over_60", null: false
t.boolean "passported", null: false
t.boolean "main_dwelling_owned", null: false
t.boolean "vehicle_owned", null: false
t.boolean "smod_assets", null: false
t.boolean "main_dwelling_owned"
t.boolean "vehicle_owned"
t.boolean "smod_assets"
t.string "outcome", null: false
t.boolean "capital_contribution", null: false
t.boolean "capital_contribution"
t.boolean "income_contribution", null: false
t.date "completed"
t.boolean "form_downloaded", default: false
Expand All @@ -106,6 +106,7 @@
t.string "client_age"
t.jsonb "session"
t.string "office_code"
t.string "early_result_type"
t.index ["assessment_id"], name: "index_completed_user_journeys_on_assessment_id", unique: true
end

Expand Down