Skip to content

Commit

Permalink
Change interview_duration to an integer field
Browse files Browse the repository at this point in the history
  • Loading branch information
zachlatta committed Jan 28, 2018
1 parent 08300c7 commit 8b12bdb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

# Not preserving data in this migration because it is part of the same PR that
# interview_duration was added in, so there is no data to preserve.
class ChangeInterviewDurationToInteger < ActiveRecord::Migration[5.1]
def up
remove_column :new_club_applications, :interview_duration
add_column :new_club_applications, :interview_duration, :integer
end

def down
remove_column :new_club_applications, :interview_duration
add_column :new_club_applications, :interview_duration, :interval
end
end
4 changes: 2 additions & 2 deletions api/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.define(version: 20180127234239) do
ActiveRecord::Schema.define(version: 20180128111910) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -276,8 +276,8 @@
t.datetime "submitted_at"
t.json "legacy_fields"
t.datetime "interviewed_at"
t.interval "interview_duration"
t.text "interview_notes"
t.integer "interview_duration"
t.index ["point_of_contact_id"], name: "index_new_club_applications_on_point_of_contact_id"
end

Expand Down
2 changes: 1 addition & 1 deletion api/spec/requests/v1/new_club_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
expect(
Time.zone.parse(json['interviewed_at'])
).to be_within(3.seconds).of(Time.current)
expect(json).to include('interview_duration' => 30.minutes.to_s)
expect(json).to include('interview_duration' => 30.minutes)
expect(json).to include('interview_notes' => 'Went well.')
end

Expand Down

0 comments on commit 8b12bdb

Please sign in to comment.