Commit f5ad5e6c authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch '15886-composer-package-id' into 'master'

Adds composer package id to packages model

See merge request gitlab-org/gitlab!29454
parents bacaf50c f8b72367
......@@ -33,7 +33,7 @@ class Packages::Package < ApplicationRecord
validate :package_already_taken, if: :npm?
validates :version, format: { with: Gitlab::Regex.semver_regex }, if: :npm?
enum package_type: { maven: 1, npm: 2, conan: 3, nuget: 4, pypi: 5 }
enum package_type: { maven: 1, npm: 2, conan: 3, nuget: 4, pypi: 5, composer: 6 }
scope :with_name, ->(name) { where(name: name) }
scope :with_name_like, ->(name) { where(arel_table[:name].matches(name)) }
......
......@@ -61,6 +61,12 @@ FactoryBot.define do
end
end
factory :composer_package do
sequence(:name) { |n| "composer-package-#{n}"}
sequence(:version) { |n| "1.0.#{n}" }
package_type { :composer }
end
factory :conan_package do
conan_metadatum
......
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