diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-05-03 22:37:43 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-05-04 15:36:04 -0300 |
commit | 341964da45460d5c6593d0e08178ecf61e726e91 (patch) | |
tree | 0b703bfdb84885487c4521eab3c9ddcef4146878 /db/migrate | |
parent | cdcbe99aa749d4516f47ca9d2e7d510dc29d1c91 (diff) | |
download | gitlab-ce-341964da45460d5c6593d0e08178ecf61e726e91.tar.gz |
Add index to last_repository_updated_at on projects
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb b/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb new file mode 100644 index 00000000000..6144d74745c --- /dev/null +++ b/db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb @@ -0,0 +1,15 @@ +class AddIndexToLastRepositoryUpdatedAtOnProjects < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index(:projects, :last_repository_updated_at) + end + + def down + remove_concurrent_index(:projects, :last_repository_updated_at) if index_exists?(:projects, :last_repository_updated_at) + end +end |