diff options
author | Nick Thomas <nick@gitlab.com> | 2016-12-08 04:09:18 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-12-15 16:57:03 +0300 |
commit | 93a03cd92f6418fbeaf126c30c161ab40d377e94 (patch) | |
tree | 0f49cd51558b97b8674e72b200e7d9150562e00e /db/migrate/20161209153400_add_unique_index_for_environment_slug.rb | |
parent | 35a3e9183052bab847c30203f27fea9cf77901a4 (diff) |
Add an environment slug
Diffstat (limited to 'db/migrate/20161209153400_add_unique_index_for_environment_slug.rb')
-rw-r--r-- | db/migrate/20161209153400_add_unique_index_for_environment_slug.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb b/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb new file mode 100644 index 00000000000..e9fcef1cd45 --- /dev/null +++ b/db/migrate/20161209153400_add_unique_index_for_environment_slug.rb @@ -0,0 +1,15 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddUniqueIndexForEnvironmentSlug < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = true + DOWNTIME_REASON = 'Adding a *unique* index to environments.slug' + + disable_ddl_transaction! + + def change + add_concurrent_index :environments, [:project_id, :slug], unique: true + end +end |