Commit eb2ed2f1 authored by Steve Abrams's avatar Steve Abrams

Ignore file_type in Packages::PackageFile

First step in removing the unused file_type
column in packages_package_files

Ignore the column, remove all remaining references
parent 070abce6
......@@ -2,6 +2,9 @@
class Packages::PackageFile < ApplicationRecord
include UpdateProjectStatistics
include ::Gitlab::Geo::ReplicableModel
include IgnorableColumns
ignore_column :file_type, remove_with: '12.10', remove_after: '2019-03-22'
delegate :project, :project_id, to: :package
delegate :conan_file_type, to: :conan_file_metadatum
......
......@@ -16,7 +16,6 @@ module Packages
file: file,
size: params['file.size'],
file_name: params[:file_name],
file_type: params['file.type'],
file_sha1: params['file.sha1'],
file_md5: params['file.md5'],
conan_file_metadatum_attributes: {
......
......@@ -13,7 +13,6 @@ module Packages
file: params[:file],
size: params[:size],
file_name: params[:file_name],
file_type: params[:file_type],
file_sha1: params[:file_sha1],
file_md5: params[:file_md5]
)
......
......@@ -15,7 +15,6 @@ module API
POSITIVE_INTEGER_REGEX = %r{\A[1-9]\d*\z}.freeze
PACKAGE_FILENAME = 'package.nupkg'
PACKAGE_FILETYPE = 'application/octet-stream'
default_format :json
......@@ -95,8 +94,7 @@ module API
file_params = params.merge(
file: uploaded_package_file(:package),
file_name: PACKAGE_FILENAME,
file_type: PACKAGE_FILETYPE
file_name: PACKAGE_FILENAME
)
package = ::Packages::Nuget::CreatePackageService.new(authorized_user_project, current_user)
......
......@@ -170,7 +170,6 @@ FactoryBot.define do
file { fixture_file_upload('ee/spec/fixtures/nuget/package.nupkg') }
file_name { 'package.nupkg' }
file_sha1 { '5fe852b2a6abd96c22c11fa1ff2fb19d9ce58b57' }
file_type { 0 }
size { 300.kilobytes }
end
......
......@@ -166,7 +166,6 @@ RSpec.shared_examples 'process nuget upload' do |user_type, status, add_member =
package_file = project.packages.last.package_files.reload.last
expect(package_file.file_name).to eq('package.nupkg')
expect(package_file.file_type).to eq(0)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment