Skip to content

Instantly share code, notes, and snippets.

@yuri-karpovich
Last active July 26, 2021 11:52
Show Gist options
  • Save yuri-karpovich/1da15d34ba4f464a8f53d19d27b80a33 to your computer and use it in GitHub Desktop.
Save yuri-karpovich/1da15d34ba4f464a8f53d19d27b80a33 to your computer and use it in GitHub Desktop.

Revisions

  1. yuri-karpovich revised this gist Jul 26, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion database.yml
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,4 @@ development:
    # Do not set this db to the same as development or production.
    test:
    <<: *default
    database: <%= ENV.fetch("MYSQL_DATABASE") %>
    database: <%= [ENV.fetch("MYSQL_DATABASE"), 'test'].join('_') %>
  2. yuri-karpovich created this gist Jul 26, 2021.
    26 changes: 26 additions & 0 deletions database.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    default: &default
    adapter: mysql2
    encoding: utf8
    host: <%= ENV.fetch("MYSQL_HOST") { 'mysql' } %>
    database: <%= ENV.fetch("MYSQL_DATABASE") %>
    port: <%= ENV.fetch("MYSQL_PORT") { 3306 } %>
    pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 60 } %>
    reconnect: true
    username: <%= ENV.fetch("MYSQL_USER") %>
    password: "<%= ENV.fetch("MYSQL_PASSWORD") %>"

    variables:
    sql_mode: TRADITIONAL,STRICT_TRANS_TABLES

    production:
    <<: *default

    development:
    <<: *default

    # 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:
    <<: *default
    database: <%= ENV.fetch("MYSQL_DATABASE") %>