diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20170503004125_add_last_repository_updated_at_to_projects.rb | 7 | ||||
-rw-r--r-- | db/migrate/20170503004425_add_index_to_last_repository_updated_at_on_projects.rb | 15 |
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 |