summaryrefslogtreecommitdiff
path: root/db/migrate/20201125030847_create_dependency_proxy_manifests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20201125030847_create_dependency_proxy_manifests.rb')
-rw-r--r--db/migrate/20201125030847_create_dependency_proxy_manifests.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/db/migrate/20201125030847_create_dependency_proxy_manifests.rb b/db/migrate/20201125030847_create_dependency_proxy_manifests.rb
new file mode 100644
index 00000000000..6c1a3f23bf3
--- /dev/null
+++ b/db/migrate/20201125030847_create_dependency_proxy_manifests.rb
@@ -0,0 +1,33 @@
+# frozen_string_literal: true
+
+class CreateDependencyProxyManifests < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :dependency_proxy_manifests, if_not_exists: true do |t|
+ t.timestamps_with_timezone
+ t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }, type: :bigint
+ t.bigint :size
+ t.integer :file_store, limit: 2
+ t.text :file_name, null: false
+ t.text :file, null: false
+ t.text :digest, null: false
+
+ t.index [:group_id, :digest], name: 'index_dependency_proxy_manifests_on_group_id_and_digest'
+ end
+ end
+
+ add_text_limit :dependency_proxy_manifests, :file_name, 255
+ add_text_limit :dependency_proxy_manifests, :file, 255
+ add_text_limit :dependency_proxy_manifests, :digest, 255
+ end
+
+ def down
+ drop_table :dependency_proxy_manifests
+ end
+end