diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-02 00:09:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-02 00:09:14 +0000 |
commit | d8714cf67ce4db786b26b64f0f0bef50fb6976e6 (patch) | |
tree | 9a3cc1da29cb2a16113b6b8a1a48b82f368cbb22 /db/migrate/20210112202949_create_composer_cache_file.rb | |
parent | 3feea9b6078811d20b42548ba98272eeed5af9e4 (diff) | |
download | gitlab-ce-d8714cf67ce4db786b26b64f0f0bef50fb6976e6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20210112202949_create_composer_cache_file.rb')
-rw-r--r-- | db/migrate/20210112202949_create_composer_cache_file.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/db/migrate/20210112202949_create_composer_cache_file.rb b/db/migrate/20210112202949_create_composer_cache_file.rb new file mode 100644 index 00000000000..b1c2a1608dd --- /dev/null +++ b/db/migrate/20210112202949_create_composer_cache_file.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class CreateComposerCacheFile < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + # rubocop:disable Migration/AddLimitToTextColumns + create_table_with_constraints :packages_composer_cache_files do |t| + t.timestamps_with_timezone + + # record can be deleted after `delete_at` + t.datetime_with_timezone :delete_at + + # which namespace it belongs to + t.integer :namespace_id, null: true + + # file storage related fields + t.integer :file_store, limit: 2, null: false, default: 1 + t.text :file, null: false + t.binary :file_sha256, null: false + + t.index [:namespace_id, :file_sha256], name: "index_packages_composer_cache_namespace_and_sha", using: :btree, unique: true + t.foreign_key :namespaces, column: :namespace_id, on_delete: :nullify + + t.text_limit :file, 255 + end + end + + def down + drop_table :packages_composer_cache_files + end +end |