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:
authorGabriel Mazetto <brodock@gmail.com>2017-08-02 05:11:35 +0300
committerGabriel Mazetto <brodock@gmail.com>2017-08-22 07:33:20 +0300
commit53403399577bdca0e8f0886fa62ce0e75c14a8e0 (patch)
tree4ba58b5848ef0ba9fb07ce88ec7a0a40564187b6 /db/migrate/20170802013652_add_storage_fields_to_project.rb
parent950c87308aa7e9f3ae5bf84790d30d6fcb688fc8 (diff)
Add UUID Storage to Project
Diffstat (limited to 'db/migrate/20170802013652_add_storage_fields_to_project.rb')
-rw-r--r--db/migrate/20170802013652_add_storage_fields_to_project.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/db/migrate/20170802013652_add_storage_fields_to_project.rb b/db/migrate/20170802013652_add_storage_fields_to_project.rb
new file mode 100644
index 00000000000..269103cd472
--- /dev/null
+++ b/db/migrate/20170802013652_add_storage_fields_to_project.rb
@@ -0,0 +1,39 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddStorageFieldsToProject < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ # When a migration requires downtime you **must** uncomment the following
+ # constant and define a short and easy to understand explanation as to why the
+ # migration requires downtime.
+ # DOWNTIME_REASON = ''
+
+ # When using the methods "add_concurrent_index", "remove_concurrent_index" or
+ # "add_column_with_default" you must disable the use of transactions
+ # as these methods can not run in an existing transaction.
+ # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
+ # that either of them is the _only_ method called in the migration,
+ # any other changes should go in a separate migration.
+ # This ensures that upon failure _only_ the index creation or removing fails
+ # and can be retried or reverted easily.
+ #
+ # To disable transactions uncomment the following line and remove these
+ # comments:
+ disable_ddl_transaction!
+
+ def up
+ # rubocop:disable Migration/AddColumnWithDefaultToLargeTable
+ add_column :projects, :uuid, :uuid
+ add_column_with_default :projects, :storage_version, :integer, default: 0, limit: 1
+ add_concurrent_index :projects, :uuid
+ end
+
+ def down
+ remove_column :projects, :uuid
+ remove_column :projects, :storage_version
+ end
+end