summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-04 22:48:21 +0000
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-05-04 22:48:21 +0000
commit12fbce2eacdfbbc9bca7f7eaca6e5679ee1aaffd (patch)
tree055c994736a0408af7c6b4c5ff6ca37ec65c336c /db/migrate
parent1bf694fcb95c978e8cf32664b3ced186e7a7d850 (diff)
parent79dc817183bf1480e72016c3e6a78ac0e57d8c96 (diff)
downloadgitlab-ce-12fbce2eacdfbbc9bca7f7eaca6e5679ee1aaffd.tar.gz
Merge branch 'master' into 'add-sentry-js-again-with-vue'
# Conflicts: # db/schema.rb
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb7
-rw-r--r--db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb15
2 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb b/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb
new file mode 100644
index 00000000000..00c685cf342
--- /dev/null
+++ b/db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb
@@ -0,0 +1,7 @@
+class AddLastRepositoryUpdatedAtToProjects < ActiveRecord::Migration
+ DOWNTIME = false
+
+ def change
+ add_column :projects, :last_repository_updated_at, :datetime
+ end
+end
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