diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /db/migrate/20201204111500_create_packages_debian_group_component_files.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'db/migrate/20201204111500_create_packages_debian_group_component_files.rb')
-rw-r--r-- | db/migrate/20201204111500_create_packages_debian_group_component_files.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/db/migrate/20201204111500_create_packages_debian_group_component_files.rb b/db/migrate/20201204111500_create_packages_debian_group_component_files.rb new file mode 100644 index 00000000000..2592d5b108a --- /dev/null +++ b/db/migrate/20201204111500_create_packages_debian_group_component_files.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class CreatePackagesDebianGroupComponentFiles < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + INDEX_ARCHITECTURE = 'idx_packages_debian_group_component_files_on_architecture_id' + + disable_ddl_transaction! + + def up + with_lock_retries do + unless table_exists?(:packages_debian_group_component_files) + create_table :packages_debian_group_component_files do |t| + t.timestamps_with_timezone + t.references :component, + foreign_key: { to_table: :packages_debian_group_components, on_delete: :restrict }, + null: false, + index: true + t.references :architecture, + foreign_key: { to_table: :packages_debian_group_architectures, on_delete: :restrict }, + index: { name: INDEX_ARCHITECTURE } + t.integer :size, null: false + t.integer :file_type, limit: 2, null: false + t.integer :compression_type, limit: 2 + t.integer :file_store, limit: 2, default: 1, null: false + t.text :file, null: false + t.binary :file_md5, null: false + t.binary :file_sha256, null: false + end + end + end + + add_text_limit :packages_debian_group_component_files, :file, 255 + end + + def down + drop_table :packages_debian_group_component_files + end +end |