Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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.rb41
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