diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb')
-rw-r--r-- | db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb b/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb new file mode 100644 index 00000000000..1e79b4e29b0 --- /dev/null +++ b/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +class CreatePackagesDebianGroupDistributionKeys < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + INDEX_DISTRIBUTION = 'idx_pkgs_debian_group_distribution_keys_on_distribution_id' + + disable_ddl_transaction! + + def up + create_table_with_constraints :packages_debian_group_distribution_keys do |t| + t.timestamps_with_timezone + t.references :distribution, + foreign_key: { to_table: :packages_debian_group_distributions, on_delete: :cascade }, + index: { name: INDEX_DISTRIBUTION }, + null: false + + t.text :encrypted_private_key, null: false + t.text :encrypted_private_key_iv, null: false + t.text :encrypted_passphrase, null: false + t.text :encrypted_passphrase_iv, null: false + t.text :public_key, null: false + t.text :fingerprint, null: false + + t.text_limit :public_key, 512.kilobytes + t.text_limit :fingerprint, 255 + end + end + + def down + with_lock_retries do + drop_table :packages_debian_group_distribution_keys + end + end +end |