Commit 3bb09def authored by Toon Claes's avatar Toon Claes

Merge branch '208747-adds-sha256-to-package-files' into 'master'

Adds sha256 to package files

See merge request gitlab-org/gitlab!27518
parents 2741e514 04568393
# frozen_string_literal: true
class AddsSha256ToPackageFiles < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
add_column :packages_package_files, :file_sha256, :binary
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_16_111759) do
ActiveRecord::Schema.define(version: 2020_03_18_152134) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -3057,6 +3057,7 @@ ActiveRecord::Schema.define(version: 2020_03_16_111759) do
t.binary "file_sha1"
t.string "file_name", null: false
t.text "file", null: false
t.binary "file_sha256"
t.index ["package_id", "file_name"], name: "index_packages_package_files_on_package_id_and_file_name"
end
......
......@@ -10,11 +10,12 @@ module Packages
def execute
package.package_files.create!(
file: params[:file],
size: params[:size],
file_name: params[:file_name],
file_sha1: params[:file_sha1],
file_md5: params[:file_md5]
file: params[:file],
size: params[:size],
file_name: params[:file_name],
file_sha1: params[:file_sha1],
file_sha256: params[:file_sha256],
file_md5: params[:file_md5]
)
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