Commit dd5500f1 authored by Thong Kuah's avatar Thong Kuah

Merge branch '197480-remove-packages-file_type-column' into 'master'

Ignore file_type in Packages::PackageFile

See merge request gitlab-org/gitlab!24534
parents 25924dac eb2ed2f1
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
class Packages::PackageFile < ApplicationRecord class Packages::PackageFile < ApplicationRecord
include UpdateProjectStatistics include UpdateProjectStatistics
include ::Gitlab::Geo::ReplicableModel 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 :project, :project_id, to: :package
delegate :conan_file_type, to: :conan_file_metadatum delegate :conan_file_type, to: :conan_file_metadatum
......
...@@ -16,7 +16,6 @@ module Packages ...@@ -16,7 +16,6 @@ module Packages
file: file, file: file,
size: params['file.size'], size: params['file.size'],
file_name: params[:file_name], file_name: params[:file_name],
file_type: params['file.type'],
file_sha1: params['file.sha1'], file_sha1: params['file.sha1'],
file_md5: params['file.md5'], file_md5: params['file.md5'],
conan_file_metadatum_attributes: { conan_file_metadatum_attributes: {
......
...@@ -13,7 +13,6 @@ module Packages ...@@ -13,7 +13,6 @@ module Packages
file: params[:file], file: params[:file],
size: params[:size], size: params[:size],
file_name: params[:file_name], file_name: params[:file_name],
file_type: params[:file_type],
file_sha1: params[:file_sha1], file_sha1: params[:file_sha1],
file_md5: params[:file_md5] file_md5: params[:file_md5]
) )
......
...@@ -15,7 +15,6 @@ module API ...@@ -15,7 +15,6 @@ module API
POSITIVE_INTEGER_REGEX = %r{\A[1-9]\d*\z}.freeze POSITIVE_INTEGER_REGEX = %r{\A[1-9]\d*\z}.freeze
PACKAGE_FILENAME = 'package.nupkg' PACKAGE_FILENAME = 'package.nupkg'
PACKAGE_FILETYPE = 'application/octet-stream'
default_format :json default_format :json
...@@ -95,8 +94,7 @@ module API ...@@ -95,8 +94,7 @@ module API
file_params = params.merge( file_params = params.merge(
file: uploaded_package_file(:package), file: uploaded_package_file(:package),
file_name: PACKAGE_FILENAME, file_name: PACKAGE_FILENAME
file_type: PACKAGE_FILETYPE
) )
package = ::Packages::Nuget::CreatePackageService.new(authorized_user_project, current_user) package = ::Packages::Nuget::CreatePackageService.new(authorized_user_project, current_user)
......
...@@ -170,7 +170,6 @@ FactoryBot.define do ...@@ -170,7 +170,6 @@ FactoryBot.define do
file { fixture_file_upload('ee/spec/fixtures/nuget/package.nupkg') } file { fixture_file_upload('ee/spec/fixtures/nuget/package.nupkg') }
file_name { 'package.nupkg' } file_name { 'package.nupkg' }
file_sha1 { '5fe852b2a6abd96c22c11fa1ff2fb19d9ce58b57' } file_sha1 { '5fe852b2a6abd96c22c11fa1ff2fb19d9ce58b57' }
file_type { 0 }
size { 300.kilobytes } size { 300.kilobytes }
end end
......
...@@ -166,7 +166,6 @@ RSpec.shared_examples 'process nuget upload' do |user_type, status, add_member = ...@@ -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 package_file = project.packages.last.package_files.reload.last
expect(package_file.file_name).to eq('package.nupkg') expect(package_file.file_name).to eq('package.nupkg')
expect(package_file.file_type).to eq(0)
end end
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