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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 21:18:33 +0300
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /db/post_migrate/20210222192144_remove_backup_labels_table.rb
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'db/post_migrate/20210222192144_remove_backup_labels_table.rb')
-rw-r--r--db/post_migrate/20210222192144_remove_backup_labels_table.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/db/post_migrate/20210222192144_remove_backup_labels_table.rb b/db/post_migrate/20210222192144_remove_backup_labels_table.rb
new file mode 100644
index 00000000000..1208c3c970f
--- /dev/null
+++ b/db/post_migrate/20210222192144_remove_backup_labels_table.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+class RemoveBackupLabelsTable < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def up
+ drop_table :backup_labels
+ end
+
+ def down
+ create_table :backup_labels, id: false do |t|
+ t.integer :id, null: false
+ t.string :title
+ t.string :color
+ t.integer :project_id
+ t.timestamps null: true # rubocop:disable Migration/Timestamps
+ t.boolean :template, default: false
+ t.string :description
+ t.text :description_html
+ t.string :type
+ t.integer :group_id
+ t.integer :cached_markdown_version
+ t.integer :restore_action
+ t.string :new_title
+ end
+
+ execute 'ALTER TABLE backup_labels ADD PRIMARY KEY (id)'
+
+ add_index :backup_labels, [:group_id, :project_id, :title], name: 'backup_labels_group_id_project_id_title_idx', unique: true
+ add_index :backup_labels, [:group_id, :title], where: 'project_id = NULL::integer', name: 'backup_labels_group_id_title_idx'
+ add_index :backup_labels, :project_id, name: 'backup_labels_project_id_idx'
+ add_index :backup_labels, :template, name: 'backup_labels_template_idx', where: 'template'
+ add_index :backup_labels, :title, name: 'backup_labels_title_idx'
+ add_index :backup_labels, [:type, :project_id], name: 'backup_labels_type_project_id_idx'
+ end
+end