Skip to content

Commit

Permalink
Migrations to create projection_assessment_runs and projection_assess…
Browse files Browse the repository at this point in the history
…ments
  • Loading branch information
moveson committed Mar 13, 2024
1 parent 315ad6b commit 63a1130
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
21 changes: 21 additions & 0 deletions db/migrate/20240313132008_create_projection_assessment_runs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class CreateProjectionAssessmentRuns < ActiveRecord::Migration[7.0]
def change
create_table :projection_assessment_runs do |t|
t.references :event, null: false, foreign_key: true
t.integer :completed_lap, null: false
t.integer :completed_split_id, null: false
t.integer :completed_bitkey, null: false
t.integer :projected_lap, null: false
t.integer :projected_split_id, null: false
t.integer :projected_bitkey, null: false
t.integer :status
t.string :error_message
t.integer :success_count
t.integer :failure_count
t.datetime :started_at
t.integer :elapsed_time

t.timestamps
end
end
end
14 changes: 14 additions & 0 deletions db/migrate/20240313132913_create_projection_assessments.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateProjectionAssessments < ActiveRecord::Migration[7.0]
def change
create_table :projection_assessments do |t|
t.references :projection_assessment_run, null: false, foreign_key: true
t.references :effort, null: false, foreign_key: true
t.datetime :projected_early
t.datetime :projected_best
t.datetime :projected_late
t.datetime :actual

t.timestamps
end
end
end
37 changes: 36 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[7.0].define(version: 2023_09_20_165528) do
ActiveRecord::Schema[7.0].define(version: 2024_03_13_132913) do
# These are extensions that must be enabled in order to support this database
enable_extension "fuzzystrmatch"
enable_extension "pg_trgm"
Expand Down Expand Up @@ -448,6 +448,38 @@
t.index ["user_id"], name: "index_people_on_user_id"
end

create_table "projection_assessment_runs", force: :cascade do |t|
t.bigint "event_id", null: false
t.integer "completed_lap", null: false
t.integer "completed_split_id", null: false
t.integer "completed_bitkey", null: false
t.integer "projected_lap", null: false
t.integer "projected_split_id", null: false
t.integer "projected_bitkey", null: false
t.integer "status"
t.string "error_message"
t.integer "success_count"
t.integer "failure_count"
t.datetime "started_at"
t.integer "elapsed_time"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["event_id"], name: "index_projection_assessment_runs_on_event_id"
end

create_table "projection_assessments", force: :cascade do |t|
t.bigint "projection_assessment_run_id", null: false
t.bigint "effort_id", null: false
t.datetime "projected_early"
t.datetime "projected_best"
t.datetime "projected_late"
t.datetime "actual"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["effort_id"], name: "index_projection_assessments_on_effort_id"
t.index ["projection_assessment_run_id"], name: "index_projection_assessments_on_projection_assessment_run_id"
end

create_table "raw_times", force: :cascade do |t|
t.bigint "event_group_id", null: false
t.bigint "split_time_id"
Expand Down Expand Up @@ -699,6 +731,9 @@
add_foreign_key "lottery_tickets", "lottery_entrants"
add_foreign_key "notifications", "efforts"
add_foreign_key "people", "users"
add_foreign_key "projection_assessment_runs", "events"
add_foreign_key "projection_assessments", "efforts"
add_foreign_key "projection_assessments", "projection_assessment_runs"
add_foreign_key "raw_times", "event_groups"
add_foreign_key "raw_times", "split_times"
add_foreign_key "results_categories", "organizations"
Expand Down
Binary file modified erd.pdf
Binary file not shown.

0 comments on commit 63a1130

Please sign in to comment.