From f8186fb86fa2b31b6d3b2d7042a26003a588335f Mon Sep 17 00:00:00 2001 From: moveson Date: Wed, 18 Dec 2024 20:19:46 -0700 Subject: [PATCH] Migration to rename file_downloads table to analytics_file_downloads --- ...e_downloads_to_analytics_file_downloads.rb | 5 +++ db/schema.rb | 30 +++++++++--------- erd.pdf | Bin 76461 -> 76461 bytes 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 db/migrate/20241219031810_rename_file_downloads_to_analytics_file_downloads.rb diff --git a/db/migrate/20241219031810_rename_file_downloads_to_analytics_file_downloads.rb b/db/migrate/20241219031810_rename_file_downloads_to_analytics_file_downloads.rb new file mode 100644 index 000000000..dcc258bf3 --- /dev/null +++ b/db/migrate/20241219031810_rename_file_downloads_to_analytics_file_downloads.rb @@ -0,0 +1,5 @@ +class RenameFileDownloadsToAnalyticsFileDownloads < ActiveRecord::Migration[7.0] + def change + rename_table :file_downloads, :analytics_file_downloads + end +end diff --git a/db/schema.rb b/db/schema.rb index 89844e8e0..b661a04c7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_12_19_004057) do +ActiveRecord::Schema[7.0].define(version: 2024_12_19_031810) do # These are extensions that must be enabled in order to support this database enable_extension "fuzzystrmatch" enable_extension "pg_trgm" @@ -54,6 +54,19 @@ t.index ["split_id"], name: "index_aid_stations_on_split_id" end + create_table "analytics_file_downloads", force: :cascade do |t| + t.bigint "user_id", null: false + t.string "record_type", null: false + t.bigint "record_id", null: false + t.string "name", null: false + t.string "filename", null: false + t.string "byte_size", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["record_type", "record_id"], name: "index_file_downloads_on_record" + t.index ["user_id"], name: "index_analytics_file_downloads_on_user_id" + end + create_table "connections", force: :cascade do |t| t.string "service_identifier", null: false t.string "source_type", null: false @@ -255,19 +268,6 @@ t.index ["user_id"], name: "index_export_jobs_on_user_id" end - create_table "file_downloads", force: :cascade do |t| - t.bigint "user_id", null: false - t.string "record_type", null: false - t.bigint "record_id", null: false - t.string "name", null: false - t.string "filename", null: false - t.string "byte_size", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["record_type", "record_id"], name: "index_file_downloads_on_record" - t.index ["user_id"], name: "index_file_downloads_on_user_id" - end - create_table "friendly_id_slugs", force: :cascade do |t| t.string "slug", null: false t.integer "sluggable_id", null: false @@ -767,6 +767,7 @@ add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "aid_stations", "events" add_foreign_key "aid_stations", "splits" + add_foreign_key "analytics_file_downloads", "users" add_foreign_key "course_group_courses", "course_groups" add_foreign_key "course_group_courses", "courses" add_foreign_key "course_groups", "organizations" @@ -782,7 +783,6 @@ add_foreign_key "events", "courses" add_foreign_key "events", "event_groups" add_foreign_key "export_jobs", "users" - add_foreign_key "file_downloads", "users" add_foreign_key "historical_facts", "organizations" add_foreign_key "historical_facts", "people" add_foreign_key "import_jobs", "users" diff --git a/erd.pdf b/erd.pdf index 4befaeca83a7cfea92a2455e89a0e158a803aedc..dd9902e74c8d11e2e45faf1855c20c9e8b5ca940 100644 GIT binary patch delta 575 zcmV-F0>J&P)da281c0;w=O=&DB(7fc`jDfVhjU7S^Rv1Q-IM)AuiPnyh)A!?h zdGGO2kce-vArS-J(1>%aw>&Beq?g;Ekk+DAHUf~ob&bUb7zj@IoKUI9-hoE@{iLXk zZbqpLVktVKK@*xM4Dr>u!S2#@qOB3bwUai{rd_S(Z;TSI(|skJLR^3C7-1P@G-rh7 z8GRw!XF^ts$zLoydF!CBg;60#NH&3Y)pX*Ze|%ixUq*NaMhSn!?wuD{WDmvB=y5<% zgdxnc%S0D+_SA^p4#7>{7W@ilMzu_(->TGiC)MeA2+*ev{G_ZNjZ_xvhv(S~rJKWB ze}{hsOX0+qZtwm44eki_{L(M~32#J~?kE8t0yjCA4=DjH0XCQ6BLNwcaDfDuS}6fW ze}Z8c#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