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/20210121093618_remove_repository_read_only_to_groups.rb')
-rw-r--r--db/migrate/20210121093618_remove_repository_read_only_to_groups.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb b/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb
new file mode 100644
index 00000000000..0b353ba5d88
--- /dev/null
+++ b/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveRepositoryReadOnlyToGroups < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ if column_exists?(:namespaces, :repository_read_only)
+ with_lock_retries do
+ remove_column :namespaces, :repository_read_only # rubocop:disable Migration/RemoveColumn
+ end
+ end
+ end
+
+ def down
+ unless column_exists?(:namespaces, :repository_read_only)
+ with_lock_retries do
+ add_column :namespaces, :repository_read_only, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
+ end
+ end
+ end
+end