Skip to content

Commit

Permalink
Create a Rails Migration to Add a 'scheduled_datetime' (#22408)
Browse files Browse the repository at this point in the history
* Create a Rails Migration to Add a 'scheduled_datetime' Column of Type timestamptz to the Postgres hearing Table

* include the schema.rb file

* Change comment in the migration
  • Loading branch information
piedram authored Aug 6, 2024
1 parent 431c00d commit 0219288
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions db/migrate/20240805162358_add_scheduled_datetime_to_hearings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class AddScheduledDatetimeToHearings < ActiveRecord::Migration[6.0]
def up
safety_assured do
add_column :hearings, :scheduled_datetime, :timestamptz, null: true, comment: "Timestamp with zone datatype a hearing is scheduled to take place in UTC. Intended to eventually replace scheduled_time column."
end
end

def down
safety_assured do
remove_column :hearings, :scheduled_datetime
end
end
end
3 changes: 2 additions & 1 deletion 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: 2024_06_13_202232) do
ActiveRecord::Schema.define(version: 2024_08_05_162358) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -1071,6 +1071,7 @@
t.boolean "prepped", comment: "Determines whether the judge has checked the hearing as prepped"
t.string "representative_name", comment: "Name of Appellant's representative if applicable"
t.string "room", comment: "The room at BVA where the hearing will take place; ported from associated HearingDay"
t.datetime "scheduled_datetime", comment: "Timestamp with zone datatype a hearing is scheduled to take place in UTC. Intended to eventually replace scheduled_time column."
t.string "scheduled_in_timezone", comment: "Named TZ string that the hearing will have to provide accurate hearing times."
t.time "scheduled_time", null: false, comment: "Date and Time when hearing will take place"
t.text "summary", comment: "Summary of hearing"
Expand Down

0 comments on commit 0219288

Please sign in to comment.