Skip to content

Commit 45c0ec2

Browse files
committed
quality: add timestamps to tables
- address cop realted to missing timestamps
1 parent dba198e commit 45c0ec2

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class AddMissingTimestamps < ActiveRecord::Migration[8.0]
2+
def change
3+
add_timestamps :auth_tokens
4+
add_timestamps :breaks
5+
add_timestamps :campuses
6+
add_timestamps :learning_outcomes
7+
add_timestamps :teaching_periods
8+
add_timestamps :test_attempts
9+
add_timestamps :webcal_unit_exclusions
10+
add_timestamps :webcals
11+
end
12+
end

db/schema.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.1].define(version: 2025_03_27_094635) do
13+
ActiveRecord::Schema[8.0].define(version: 2025_04_02_034353) do
1414
create_table "activity_types", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
1515
t.string "name", null: false
1616
t.string "abbreviation", null: false
@@ -25,6 +25,8 @@
2525
t.bigint "user_id"
2626
t.string "authentication_token", null: false
2727
t.integer "token_type", default: 0, null: false
28+
t.datetime "created_at", null: false
29+
t.datetime "updated_at", null: false
2830
t.index ["token_type"], name: "index_auth_tokens_on_token_type"
2931
t.index ["user_id"], name: "index_auth_tokens_on_user_id"
3032
end
@@ -33,6 +35,8 @@
3335
t.datetime "start_date", null: false
3436
t.integer "number_of_weeks", null: false
3537
t.bigint "teaching_period_id"
38+
t.datetime "created_at", null: false
39+
t.datetime "updated_at", null: false
3640
t.index ["teaching_period_id"], name: "index_breaks_on_teaching_period_id"
3741
end
3842

@@ -41,6 +45,8 @@
4145
t.integer "mode", null: false
4246
t.string "abbreviation", null: false
4347
t.boolean "active", null: false
48+
t.datetime "created_at", null: false
49+
t.datetime "updated_at", null: false
4450
t.index ["abbreviation"], name: "index_campuses_on_abbreviation", unique: true
4551
t.index ["active"], name: "index_campuses_on_active"
4652
t.index ["name"], name: "index_campuses_on_name", unique: true
@@ -164,6 +170,8 @@
164170
t.string "abbreviation"
165171
t.bigint "context_id"
166172
t.string "context_type"
173+
t.datetime "created_at", null: false
174+
t.datetime "updated_at", null: false
167175
t.index ["abbreviation", "context_type", "context_id"], name: "index_learning_outcomes_on_abbreviation_and_context", unique: true
168176
t.index ["context_id", "context_type"], name: "index_learning_outcomes_on_context_id_and_context_type"
169177
end
@@ -389,6 +397,8 @@
389397
t.datetime "end_date", null: false
390398
t.integer "year", null: false
391399
t.datetime "active_until", null: false
400+
t.datetime "created_at", null: false
401+
t.datetime "updated_at", null: false
392402
t.index ["period", "year"], name: "index_teaching_periods_on_period_and_year", unique: true
393403
end
394404

@@ -400,6 +410,8 @@
400410
t.boolean "success_status", default: false
401411
t.float "score_scaled", default: 0.0
402412
t.text "cmi_datamodel"
413+
t.datetime "created_at", null: false
414+
t.datetime "updated_at", null: false
403415
t.index ["task_id"], name: "index_test_attempts_on_task_id"
404416
end
405417

@@ -599,6 +611,8 @@
599611
create_table "webcal_unit_exclusions", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
600612
t.bigint "webcal_id", null: false
601613
t.bigint "unit_id", null: false
614+
t.datetime "created_at", null: false
615+
t.datetime "updated_at", null: false
602616
t.index ["unit_id", "webcal_id"], name: "index_webcal_unit_exclusions_on_unit_id_and_webcal_id", unique: true
603617
t.index ["unit_id"], name: "index_webcal_unit_exclusions_on_unit_id"
604618
t.index ["webcal_id"], name: "fk_rails_d5fab02cb7"
@@ -610,6 +624,8 @@
610624
t.bigint "user_id"
611625
t.integer "reminder_time"
612626
t.string "reminder_unit"
627+
t.datetime "created_at", null: false
628+
t.datetime "updated_at", null: false
613629
t.index ["guid"], name: "index_webcals_on_guid", unique: true
614630
t.index ["user_id"], name: "index_webcals_on_user_id", unique: true
615631
end

0 commit comments

Comments
 (0)