default: &default
  encoding: utf8
  adapter: mysql2
  variables:
    sql_mode: TRADITIONAL
    # We need to set `sort_buffer_size` to work around a bug in MySQL 8.0.27 [1]
    # This quadruples the default sort buffer size, which seems to provide enough headroom to allow sorting to work correctly with our dataset.
    # The bug is fixed in MySQL 8.0.28 (currently unreleased), so we should be able to remove this fix once we're on that version.
    # [1]: https://bugs.mysql.com/bug.php?id=105304
    sort_buffer_size: 1048576

development:
  <<: *default
  database: whitehall_development
  username: whitehall
  password: whitehall
  url: <%= ENV["DATABASE_URL"] %>
  # Note that there is also a 'whitehall_fe' user, used
  # by the 'whitehall_frontend' machines. It should have
  # only 'SELECT' privileges on the database.

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
  <<: *default
  database: whitehall_test<%= "_executor_#{ENV['EXECUTOR_NUMBER']}_" if ENV['EXECUTOR_NUMBER']%><%= ENV['TEST_ENV_NUMBER'] %>
  username: whitehall
  password: whitehall
  url: <%= ENV["TEST_DATABASE_URL"] %><%= ENV['TEST_ENV_NUMBER'] if ENV["TEST_DATABASE_URL"] %>

production:
  <<: *default
  database: whitehall_production
  pool: 10

cucumber:
  <<: *test

default: &default
  encoding: utf8
  adapter: mysql2
  variables:
    sql_mode: TRADITIONAL

development:
  <<: *default
  database: whitehall_development
  username: whitehall
  password: whitehall
  url: <%= ENV["DATABASE_URL"] %>
  # Note that there is also a 'whitehall_fe' user, used
  # by the 'whitehall_frontend' machines. It should have
  # only 'SELECT' privileges on the database.

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
  <<: *default
  database: whitehall_test<%= "_executor_#{ENV['EXECUTOR_NUMBER']}_" if ENV['EXECUTOR_NUMBER']%><%= ENV['TEST_ENV_NUMBER'] %>
  username: whitehall
  password: whitehall
  url: <%= ENV["TEST_DATABASE_URL"] %><%= ENV['TEST_ENV_NUMBER'] if ENV["TEST_DATABASE_URL"] %>

production:
  <<: *default
  database: whitehall_production
  pool: 10

cucumber:
  <<: *test

Revert "Work around a MySQL 8.0.27 bug that broke sorting"
Revert "Work around a MySQL 8.0.27 bug that broke sorting"

This reverts commit 19712a2a2e5f2bf691132d4625d582b709d123bc.

Now that MySQL 8.0.28 has been rolled out, this workaround is no longer needed.
