diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 13:34:23 -0600 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /db/migrate/20201204110700_create_packages_debian_project_distributions.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) | |
download | gitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'db/migrate/20201204110700_create_packages_debian_project_distributions.rb')
-rw-r--r-- | db/migrate/20201204110700_create_packages_debian_project_distributions.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/db/migrate/20201204110700_create_packages_debian_project_distributions.rb b/db/migrate/20201204110700_create_packages_debian_project_distributions.rb new file mode 100644 index 00000000000..5fe45c6236f --- /dev/null +++ b/db/migrate/20201204110700_create_packages_debian_project_distributions.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +class CreatePackagesDebianProjectDistributions < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + UNIQUE_CODENAME = 'uniq_pkgs_debian_project_distributions_project_id_and_codename' + UNIQUE_SUITE = 'uniq_pkgs_debian_project_distributions_project_id_and_suite' + + disable_ddl_transaction! + + def up + with_lock_retries do + unless table_exists?(:packages_debian_project_distributions) + create_table :packages_debian_project_distributions do |t| + t.timestamps_with_timezone + t.references :project, foreign_key: { to_table: :projects, on_delete: :restrict }, null: false + t.references :creator, foreign_key: { to_table: :users, on_delete: :nullify } + t.integer :valid_time_duration_seconds + t.integer :file_store, limit: 2, default: 1, null: false + t.boolean :automatic, default: true, null: false + t.boolean :automatic_upgrades, default: false, null: false + t.text :codename, null: false + t.text :suite + t.text :origin + t.text :label + t.text :version + t.text :description + t.text :encrypted_signing_keys + t.text :encrypted_signing_keys_iv + t.text :file + t.text :file_signature + + t.index %w(project_id codename), + name: UNIQUE_CODENAME, + unique: true, + using: :btree + t.index %w(project_id suite), + name: UNIQUE_SUITE, + unique: true, + using: :btree + end + end + end + + add_text_limit :packages_debian_project_distributions, :codename, 255 + add_text_limit :packages_debian_project_distributions, :suite, 255 + add_text_limit :packages_debian_project_distributions, :origin, 255 + add_text_limit :packages_debian_project_distributions, :label, 255 + add_text_limit :packages_debian_project_distributions, :version, 255 + add_text_limit :packages_debian_project_distributions, :description, 255 + add_text_limit :packages_debian_project_distributions, :encrypted_signing_keys, 2048 + add_text_limit :packages_debian_project_distributions, :encrypted_signing_keys_iv, 255 + add_text_limit :packages_debian_project_distributions, :file, 255 + add_text_limit :packages_debian_project_distributions, :file_signature, 4096 + end + + def down + drop_table :packages_debian_project_distributions + end +end |