Skip to content

Commit

Permalink
Remove deprecated Import model
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jun 11, 2024
1 parent 410370e commit 8c2666d
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 576 deletions.
1 change: 0 additions & 1 deletion app/lib/admin/metrics/dimension/space_usage_dimension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def media_size
PreviewCard.sum(:image_file_size),
Account.sum(Arel.sql('COALESCE(avatar_file_size, 0) + COALESCE(header_file_size, 0)')),
Backup.sum(:dump_file_size),
Import.sum(:data_file_size),
SiteUpload.sum(:file_file_size),
].sum

Expand Down
46 changes: 0 additions & 46 deletions app/models/import.rb

This file was deleted.

144 changes: 0 additions & 144 deletions app/services/import_service.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/settings/imports/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
= f.input :mode,
as: :radio_buttons,
collection_wrapper_tag: 'ul',
collection: Import::MODES,
collection: Form::Import::MODES,
item_wrapper_tag: 'li',
label_method: ->(mode) { safe_join([I18n.t("imports.modes.#{mode}"), content_tag(:span, I18n.t("imports.modes.#{mode}_long"), class: 'hint')]) }

Expand Down
57 changes: 0 additions & 57 deletions app/workers/import/relationship_worker.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/workers/import_worker.rb

This file was deleted.

2 changes: 1 addition & 1 deletion config/initializers/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def copy_to_local_file(style, local_dest_path)
end

Rails.application.reloader.to_prepare do
Paperclip.options[:content_type_mappings] = { csv: Import::FILE_TYPES }
Paperclip.options[:content_type_mappings] = { csv: %w(text/plain text/csv application/csv) }
end

# In some places in the code, we rescue this exception, but we don't always
Expand Down
11 changes: 11 additions & 0 deletions db/migrate/20240517144908_drop_imports.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

class DropImports < ActiveRecord::Migration[7.1]
def up
drop_table :imports
end

def down
raise ActiveRecord::IrreversibleMigration
end
end
14 changes: 0 additions & 14 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -551,19 +551,6 @@
t.index ["user_id"], name: "index_identities_on_user_id"
end

create_table "imports", force: :cascade do |t|
t.integer "type", null: false
t.boolean "approved", default: false, null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
t.string "data_file_name"
t.string "data_content_type"
t.integer "data_file_size"
t.datetime "data_updated_at", precision: nil
t.bigint "account_id", null: false
t.boolean "overwrite", default: false, null: false
end

create_table "invites", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "code", default: "", null: false
Expand Down Expand Up @@ -1321,7 +1308,6 @@
add_foreign_key "follows", "accounts", name: "fk_32ed1b5560", on_delete: :cascade
add_foreign_key "generated_annual_reports", "accounts"
add_foreign_key "identities", "users", name: "fk_bea040f377", on_delete: :cascade
add_foreign_key "imports", "accounts", name: "fk_6db1b6e408", on_delete: :cascade
add_foreign_key "invites", "users", on_delete: :cascade
add_foreign_key "list_accounts", "accounts", on_delete: :cascade
add_foreign_key "list_accounts", "follow_requests", on_delete: :cascade
Expand Down
2 changes: 0 additions & 2 deletions lib/mastodon/cli/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ def usage
say("Avatars:\t#{number_to_human_size(Account.sum(:avatar_file_size))} (#{number_to_human_size(Account.local.sum(:avatar_file_size))} local)")
say("Headers:\t#{number_to_human_size(Account.sum(:header_file_size))} (#{number_to_human_size(Account.local.sum(:header_file_size))} local)")
say("Backups:\t#{number_to_human_size(Backup.sum(:dump_file_size))}")
say("Imports:\t#{number_to_human_size(Import.sum(:data_file_size))}")
say("Settings:\t#{number_to_human_size(SiteUpload.sum(:file_file_size))}")
end

Expand Down Expand Up @@ -338,7 +337,6 @@ def file_and_thumbnail_size_sql
Account
Backup
CustomEmoji
Import
MediaAttachment
PreviewCard
SiteUpload
Expand Down
7 changes: 0 additions & 7 deletions spec/fabricators/import_fabricator.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/models/import_spec.rb

This file was deleted.

Loading

0 comments on commit 8c2666d

Please sign in to comment.