diff options
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20200324093258_add_index_on_id_creator_id_and_created_at_to_projects_table.rb | 18 | ||||
-rw-r--r-- | db/migrate/20200325152327_add_seat_link_enabled_to_application_settings.rb | 20 |
2 files changed, 38 insertions, 0 deletions
diff --git a/db/migrate/20200324093258_add_index_on_id_creator_id_and_created_at_to_projects_table.rb b/db/migrate/20200324093258_add_index_on_id_creator_id_and_created_at_to_projects_table.rb new file mode 100644 index 00000000000..6c4d59af5d6 --- /dev/null +++ b/db/migrate/20200324093258_add_index_on_id_creator_id_and_created_at_to_projects_table.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnIdCreatorIdAndCreatedAtToProjectsTable < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_service_desk_enabled_projects_on_id_creator_id_created_at' + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, [:id, :creator_id, :created_at], where: '"projects"."service_desk_enabled" = TRUE', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :projects, INDEX_NAME + end +end diff --git a/db/migrate/20200325152327_add_seat_link_enabled_to_application_settings.rb b/db/migrate/20200325152327_add_seat_link_enabled_to_application_settings.rb new file mode 100644 index 00000000000..52f579c175c --- /dev/null +++ b/db/migrate/20200325152327_add_seat_link_enabled_to_application_settings.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddSeatLinkEnabledToApplicationSettings < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default(:application_settings, :seat_link_enabled, + :boolean, + default: true, + allow_null: false) + end + + def down + remove_column(:application_settings, :seat_link_enabled) + end +end |