Skip to content

Commit

Permalink
Cleanup after uploads refactor/malware scan
Browse files Browse the repository at this point in the history
- Delete Azure-related blob data jobs/tasks
- Delete the referral_evidences table and its associations
- Delete unused test files
- Delete unnecessary keep files
  • Loading branch information
zarembas authored and gpeng committed Nov 3, 2023
1 parent ed2ef9f commit 75a3bbb
Show file tree
Hide file tree
Showing 22 changed files with 16 additions and 251 deletions.
Empty file removed app/controllers/concerns/.keep
Empty file.
16 changes: 0 additions & 16 deletions app/jobs/resend_stored_blob_data_job.rb

This file was deleted.

52 changes: 0 additions & 52 deletions app/lib/malware/resend_stored_blob_data.rb

This file was deleted.

Empty file removed app/models/concerns/.keep
Empty file.
4 changes: 0 additions & 4 deletions app/models/referral.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class Referral < ApplicationRecord

has_many :uploads, as: :uploadable

# TODO: This is a temporary association to allow us to delete referrals that have been created
# but not submitted. Once we delete the referral_evidences table we can remove this association.
has_many :referral_evidences, dependent: :destroy

has_one :allegation_upload,
-> { where(section: "allegation").order(created_at: :desc) },
class_name: "Upload",
Expand Down
6 changes: 0 additions & 6 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ shared:
- job_title
- last_name
- complete
:referral_evidences:
- id
- filename
- referral_id
- created_at
- updated_at
:referrals:
- id
- created_at
Expand Down
2 changes: 0 additions & 2 deletions config/analytics_pii.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
- first_name
- phone
- last_name
:referral_evidences:
- filename
:referrals:
- first_name
- last_name
Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20230615115253_delete_referral_evidences.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class DeleteReferralEvidences < ActiveRecord::Migration[7.0]
def change
drop_table :referral_evidences, if_exists: true do |t|
t.references :referral, index: true, foreign_key: true
t.string :filename
t.timestamps
end
end
end
26 changes: 7 additions & 19 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ActiveRecord::Schema[7.0].define(version: 2023_06_29_131752) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"

create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
Expand All @@ -21,9 +22,7 @@
t.bigint "blob_id", null: false
t.datetime "created_at", null: false
t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
t.index %w[record_type record_id name blob_id],
name: "index_active_storage_attachments_uniqueness",
unique: true
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
end

create_table "active_storage_blobs", force: :cascade do |t|
Expand All @@ -41,9 +40,7 @@
create_table "active_storage_variant_records", force: :cascade do |t|
t.bigint "blob_id", null: false
t.string "variation_digest", null: false
t.index %w[blob_id variation_digest],
name: "index_active_storage_variant_records_uniqueness",
unique: true
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end

create_table "eligibility_checks", force: :cascade do |t|
Expand Down Expand Up @@ -88,14 +85,6 @@
t.index ["referral_id"], name: "index_organisations_on_referral_id"
end

create_table "referral_evidences", force: :cascade do |t|
t.string "filename"
t.bigint "referral_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["referral_id"], name: "index_referral_evidences_on_referral_id"
end

create_table "referrals", force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
Expand Down Expand Up @@ -219,20 +208,20 @@
t.index ["email"], name: "index_staff_on_email", unique: true
t.index ["invitation_token"], name: "index_staff_on_invitation_token", unique: true
t.index ["invited_by_id"], name: "index_staff_on_invited_by_id"
t.index %w[invited_by_type invited_by_id], name: "index_staff_on_invited_by"
t.index ["invited_by_type", "invited_by_id"], name: "index_staff_on_invited_by"
t.index ["reset_password_token"], name: "index_staff_on_reset_password_token", unique: true
t.index ["unlock_token"], name: "index_staff_on_unlock_token", unique: true
end

create_table "uploads", force: :cascade do |t|
t.string "section", null: false
t.string "filename", null: false, default: ""
t.string "filename", default: "", null: false
t.string "uploadable_type"
t.bigint "uploadable_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "malware_scan_result", default: "pending", null: false
t.index %w[uploadable_type uploadable_id], name: "index_uploads_on_uploadable"
t.index ["uploadable_type", "uploadable_id"], name: "index_uploads_on_uploadable"
end

create_table "users", force: :cascade do |t|
Expand Down Expand Up @@ -263,9 +252,8 @@
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "organisations", "referrals"
add_foreign_key "referral_evidences", "referrals"
add_foreign_key "referrals", "eligibility_checks"
add_foreign_key "referrals", "users"
add_foreign_key "referrers", "referrals"
add_foreign_key "reminder_emails", "referrals", column: "referral_id"
add_foreign_key "reminder_emails", "referrals"
end
Empty file removed lib/tasks/.keep
Empty file.
12 changes: 0 additions & 12 deletions lib/tasks/malware_scan.rake

This file was deleted.

33 changes: 0 additions & 33 deletions lib/tasks/transfer_attachments.rake

This file was deleted.

67 changes: 0 additions & 67 deletions spec/lib/malware/resend_stored_blob_data_spec.rb

This file was deleted.

5 changes: 0 additions & 5 deletions test/application_system_test_case.rb

This file was deleted.

13 changes: 0 additions & 13 deletions test/channels/application_cable/connection_test.rb

This file was deleted.

Empty file removed test/controllers/.keep
Empty file.
7 changes: 0 additions & 7 deletions test/controllers/pages_controller_test.rb

This file was deleted.

Empty file removed test/helpers/.keep
Empty file.
Empty file removed test/integration/.keep
Empty file.
Empty file removed test/models/.keep
Empty file.
Empty file removed test/system/.keep
Empty file.
15 changes: 0 additions & 15 deletions test/test_helper.rb

This file was deleted.

0 comments on commit 75a3bbb

Please sign in to comment.