aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails/app/templates/config/databases
Commit message (Collapse)AuthorAgeFilesLines
* Update the sqlite db yaml template to match others and mention proper ↵Vipul A M2019-05-122-2/+2
| | | | supported version
* Replace `secrets` with `credentials` in commentsokuramasafumi2019-01-119-9/+9
| | | | | | | In comments in templates for `config/database.yml`, there is a reference to `secrets.yml` which is now deprecated. They should be replaced with `credentials.yml` so that everyone using latest Rails can understand.
* Bump the minimum version of PostgreSQL to 9.3Yasuo Honda2018-11-252-2/+2
| | | | | | | | | | | | | | | | | | | | https://www.postgresql.org/support/versioning/ - 9.1 EOLed on September 2016. - 9.2 EOLed on September 2017. 9.3 is also not supported since Nov 8, 2018. https://www.postgresql.org/about/news/1905/ I think it may be a little bit early to drop PostgreSQL 9.3 yet. * Deprecated `supports_ranges?` since no other databases support range data type * Add `supports_materialized_views?` to abstract adapter Materialized views itself is supported by other databases, other connection adapters may support them * Remove `with_manual_interventions` It was only necessary for PostgreSQL 9.1 or earlier * Drop CI against PostgreSQL 9.2
* Restore `encoding: utf8mb4` in database.ymlYasuo Honda2018-10-301-0/+1
| | | | | | | rails/rails#33853 and rails/rails#33929 removed `encoding: utf8mb4` from database.yml since at that time MySQL 5.1 is supported with the master branch. Since MySQL 5.1 has been dropped, we can restore `encoding: utf8mb4` in database.yml
* Bump MySQL version requirement to 5.5.8 in the template filesYasuo Honda2018-09-132-2/+2
| | | | Follow-up #33853
* Validate if `utf8mb4` character set and longer index key prefix is supportedYasuo Honda2018-09-131-1/+0
| | | | | | | | | | | Once #33608 merged If users create a new database using MySQL 5.1.x, it will fail to create databases since MySQL 5.1 does not know `utf8mb4` character set. This pull request removes `encoding: utf8mb4` from `mysql.yml.tt` to let create_database method handles default character set by MySQL server version. `supports_longer_index_key_prefix?` method will need to validate if MySQL 5.5 and 5.6 server configured correctly to support longer index key prefix, but not yet.
* Use utf8mb4 character set by default for MySQL database (#33608)Yasuo Honda2018-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Use utf8mb4 character set by default `utf8mb4` character set supports supplementary characters including emoji. `utf8` character set with 3-Byte encoding is not enough to support them. There was a downside of 4-Byte length character set with MySQL 5.5 and 5.6: "ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes" for Rails string data type which is mapped to varchar(255) type. MySQL 5.7 supports 3072 byte key prefix length by default. * Remove `DEFAULT COLLATE` from Active Record unit test databases There should be no "one size fits all" collation in MySQL 5.7. Let MySQL server choose the default collation for Active Record unit test databases. Users can choose their best collation for their databases by setting `options[:collation]` based on their requirements. * InnoDB FULLTEXT indexes support since MySQL 5.6 it does not have to use MyISAM storage engine whose maximum key length is 1000 bytes. Using MyISAM storag engine with utf8mb4 character set would cause "Specified key was too long; max key length is 1000 bytes" https://dev.mysql.com/doc/refman/5.6/en/innodb-fulltext-index.html * References "10.9.1 The utf8mb4 Character Set (4-Byte UTF-8 Unicode Encoding)" https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8mb4.html "10.9.2 The utf8mb3 Character Set (3-Byte UTF-8 Unicode Encoding)" https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-utf8.html "14.8.1.7 Limits on InnoDB Tables" https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html > If innodb_large_prefix is enabled (the default), the index key prefix limit is 3072 bytes > for InnoDB tables that use DYNAMIC or COMPRESSED row format. * CI against MySQL 5.7 Followed this instruction and changed root password to empty string. https://docs.travis-ci.com/user/database-setup/#MySQL-57 * The recommended minimum version of MySQL is 5.7.9 to support utf8mb4 character set and `innodb_default_row_format` MySQL 5.7.9 introduces `innodb_default_row_format` to support 3072 byte length index by default. Users do not have to change MySQL database configuration to support Rails string type. https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_default_row_format https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html > If innodb_large_prefix is enabled (the default), > the index key prefix limit is 3072 bytes for InnoDB tables that use DYNAMIC or COMPRESSED row format. * The recommended minimum version of MariaDB is 10.2.2 MariaDB 10.2.2 is the first version of MariaDB supporting `innodb_default_row_format` Also MariaDB says "MySQL 5.7 is compatible with MariaDB 10.2". - innodb_default_row_format https://mariadb.com/kb/en/library/xtradbinnodb-server-system-variables/#innodb_default_row_format - "MariaDB versus MySQL - Compatibility" https://mariadb.com/kb/en/library/mariadb-vs-mysql-compatibility/ > MySQL 5.7 is compatible with MariaDB 10.2 - "Supported Character Sets and Collations" https://mariadb.com/kb/en/library/supported-character-sets-and-collations/
* Rails guides are now served over httpsPaul McMahon2018-07-249-10/+10
| | | | | http links will be redirected to the https version, but still better to just directly link to the https version.
* OS X -> macOS [Closes #30313]Xavier Noria2018-06-231-2/+2
| | | | [Jon Moss & Xavier Noria]
* Use .tt extension to all the template filesRafael Mendonça França2017-11-1311-0/+0
| | | | | | | | Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
* Fix broken link to mysql docs in database.yml [ci skip]Yoshiyuki Hirano2017-08-222-2/+2
|
* Ensure MSSQL password uses real ENV var.Ken Collins2017-06-051-2/+2
|
* Update `database.yml` when `rails new <new_app> -d oracle` specifiedYasuo Honda2017-03-021-3/+5
| | | | | | | | | | | | | | | | - Install "activerecord-oracle_enhanced-adapter". Oracle adapter used to be a bundled one. Now it is a 3rd party one. Also "ruby-oci8" is a required gem for CRuby, not for JRuby. - Remove oracle entry for JRuby since Oracle enhanced adapter supports both CRuby and JRuby with single gem. - Change adapter name from `oracle` to `oracle_enhanced` in the oracle.yml. Not changing `-d oracle` - Update `DATABASE_URL` entry to use a dash instead of an underscore Refer https://github.com/rails/rails/commit/d72a0cbc807a14d3eec02a53317d11b9d9fa5815 for the reason.
* Modernize SQL Server database YAML for Linux/vNext.Ken Collins2017-01-271-21/+4
|
* Active Record supports MySQL >= 5.1.10Ryuta Kamizono2016-12-222-2/+2
| | | | | | | | | | | Follow up to #25307 and #23458. Related with #27422. We are using `information_schema.referential_constraints` since #25307. The table was introduced in MySQL 5.1.10. MySQL 5.0 is too old. It is enough to support >= 5.1.10 at least. MySQL 5.0 GA was released in Dec 2005 and already EOL in Dec 2011. MySQL 5.1 GA was released in Dec 2008 and already EOL in Dec 2013.
* rails -> Rails [ci skip]Santosh Wadghule2016-07-121-1/+1
|
* Use RAILS_MAX_THREADS as pool size on all adaptersEugene Kenny2016-05-2410-2/+10
| | | | | | | | When RAILS_MAX_THREADS is set, the postgresql adapter uses it as the connection pool size, so that there are always enough connections available to serve Action Cable requests. The same logic applies when using any other adapter.
* Set postgresql poolsize via RAILS_MAX_THREADSBen Sheldon2016-02-101-1/+1
|
* Active Record supports MySQL >= 5.0Ryuta Kamizono2016-02-042-2/+2
| | | | | Currently some features uses `information_schema` (e.g. foreign key support). `information_schema` introduced since MySQL 5.0.
* update supported version of PostgreSQL in docs [ci skip]yuuji.yaginuma2016-02-032-2/+2
| | | | Follow up to #23434
* Updated MySQL documentation link to MySQL latest version 5.7 everywhere [ci ↵amitkumarsuroliya2015-09-102-2/+2
| | | | | skip] Bumps from `5.6` to `5.7`
* Updated MySQL documentation link to MySQL latest version 5.6 everywhere [ci ↵amitkumarsuroliya2015-03-192-2/+2
| | | | skip]
* [ci skip] Fix typoyui-knk2014-12-091-1/+1
|
* remove rubyforge.org that was shut down [ci skip]Gaurav Sharma2014-06-062-4/+2
|
* Drop in @jeremy's new database.yml template textMatthew Draper2014-04-0911-43/+197
| | | | | In passing, allow multi-word adapters to be referenced in a URL: underscored_name must become hyphened-name.
* Revise 'sqlite3:' URL handling for smoother upgradesMatthew Draper2014-04-031-2/+4
| | | | | | | | | | | | | | | | Restore the 4.0 behaviour for 'sqlite3:///', but deprecate it. We'll change to the absolute-path interpretation in 4.2. The current "correct" spellings for in-memory, relative, and absolute URLs, respectively, are: sqlite3::memory: sqlite3:relative/path sqlite3:/full/path Substantially reverses/defers fbb79b517f3127ba620fedd01849f9628b78d6ce. Uncovered by @guilleiguaran while investigating #14495, though that sounds like a different issue.
* MySQL version 4.1 was EOL on December 31, 2009Zachary Scott2014-01-081-1/+1
| | | | We should at least recommend modern versions of MySQL to users.
* Use DATABASE_URL by defaultschneems2014-01-0211-11/+11
| | | See https://github.com/rails/rails/pull/13463#issuecomment-31480799 for full conversation.
* Move default production database to URL sub keyschneems2014-01-0110-11/+21
| | | | By using the URL sub key in the `database.yml` by default we are exposing the ability to set other attributes such as `pool` or `reap_frequency` without need of modifying the URL to contain non-connection specific information.
* Add examples and namespace ENV options with "RAILS_"José Valim2013-12-2311-12/+24
|
* Do not store production information in .yml filesJosé Valim2013-12-2311-33/+33
| | | | Instead, read information from environment variables.
* Do not expect database user with app name to existschneems2013-12-192-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default when creating a project with `--database=postgresql` the `config/database.yml` file that is generated has a user specified that is the same as the app name ``` development: adapter: postgresql encoding: unicode database: <%= app_name %>_development pool: 5 username: <%= app_name %> password: ``` This is counterintuitive and would rarely be valid. By default postgres creates a user with the current user name (http://www.postgresql.org/docs/9.3/static/database-roles.html) "it will have the same name as the operating system user that initialized the database cluster": ``` $ whoami schneems ``` If the `username` is left out postgresql will assume that you wish to log in as the default user ``` $ psql -c '\du' List of roles Role name | Attributes | Member of -----------+------------------------------------------------+----------- schneems | Superuser, Create role, Create DB, Replication | {} ``` A good sensible default then for auto generated `database.yml` files is to remove the `username`, and have postgres attempt to connect to the database as the currently logged in user. Instead of submitting with a blank password, don't submit a password.
* Correct comment in databases/postgresql.ymlDV Suresh2013-12-121-1/+1
|
* [ci skip] `apropriate` => `appropriate`, spaces addedAkshay Vishnoi2013-11-191-19/+19
|
* Extract common database defaults; better use of YAMLBenjamin Fleischer2013-11-0811-145/+85
|
* Add notes about database connection pool [ci skip]Gaurish Sharma2013-09-221-0/+2
|
* Better not use tab chars in the generator templateAkira Matsuda2013-02-201-5/+5
|
* removed dangling whitespace in generated database ymlAditya Sanghi2013-01-042-4/+4
|
* Adding sqlserver.yml template to satisfy "-d sqlserver" being givenRobert Nesius2012-11-161-0/+57
| | | | invocations of "rails new".
* Offer instructions for pg gem when installed via HomebrewOlivier Lacan2012-10-101-1/+3
|
* Change minimum (default) log level in PostgreSQL to warning.kennyj2012-06-182-4/+4
|
* copy editing [ci skip]Vijay Dev2012-04-111-3/+2
|
* Added instructions on port numberGaurish Sharma2012-04-091-0/+4
|
* Revert "let the connection pool of new applications have size 1 rather than 5"Xavier Noria2012-03-073-27/+9
| | | | | | | Reason: Temporarily reverting this because it has uncovered an issue that prevents Sam's test suite from passing. This reverts commit 9b2c38b7bd582d9712c3779294a9bccde7bbd548.
* let the connection pool of new applications have size 1 rather than 5Xavier Noria2012-02-263-9/+27
| | | | | | | | | The majority of Rails applications are multiprocess, people may wonder why rails new generates a default pool of 5, does my application need a connection pool of 5? By generating a default of 1 database.yml is much more clear, and with the comment people know what is the connection pool for, and they know it has to be bigger for multithread apps.
* removes the reconnect key from the database.yml generated for MySQLXavier Noria2012-02-241-12/+0
| | | | | | | | | | The reconnect flag does not play nicely with transactions and so it is of little use in Rails applications. Thus, albeit supported by mysql2, it does not deserve such a prominent place in the generated database.yml, which should be a representative config example. Note that the flag is false by default. Advanced users know from mysql2 docs that the flag is available.
* explains why reconnect is false by default in the database.yml generated for ↵Xavier Noria2012-02-241-1/+10
| | | | MySQL
* updating pg supported versions docco. fixes #1959Aaron Patterson2011-07-052-2/+2
|
* Use non-'jdbc*' names so that db:create and db:drop workNick Sieger2011-06-213-9/+9
|
* Add generic 'jdbc' database optionNick Sieger2011-06-211-0/+62
|