1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use official database name [ci skip]

* s/Postgres/PostgreSQL/
* s/MYSQL/MySQL/, s/Mysql/MySQL/
* s/Sqlite/SQLite/

Replaced all newly added them after 6089b31.
This commit is contained in:
Ryuta Kamizono 2019-04-03 13:08:54 +09:00
parent bffacccc6a
commit 96f0114e08
7 changed files with 11 additions and 11 deletions

View file

@ -79,7 +79,7 @@
bulk deletes by `delete_all`. bulk deletes by `delete_all`.
Supports skipping or upserting duplicates through the `ON CONFLICT` syntax Supports skipping or upserting duplicates through the `ON CONFLICT` syntax
for Postgres (9.5+) and Sqlite (3.24+) and `ON DUPLICATE KEY UPDATE` syntax for PostgreSQL (9.5+) and SQLite (3.24+) and `ON DUPLICATE KEY UPDATE` syntax
for MySQL. for MySQL.
*Bob Lail* *Bob Lail*

View file

@ -966,7 +966,7 @@ module ActiveRecord
# [<tt>:on_update</tt>] # [<tt>:on_update</tt>]
# Action that happens <tt>ON UPDATE</tt>. Valid values are +:nullify+, +:cascade+ and +:restrict+ # Action that happens <tt>ON UPDATE</tt>. Valid values are +:nullify+, +:cascade+ and +:restrict+
# [<tt>:validate</tt>] # [<tt>:validate</tt>]
# (Postgres only) Specify whether or not the constraint should be validated. Defaults to +true+. # (PostgreSQL only) Specify whether or not the constraint should be validated. Defaults to +true+.
def add_foreign_key(from_table, to_table, options = {}) def add_foreign_key(from_table, to_table, options = {})
return unless supports_foreign_keys? return unless supports_foreign_keys?

View file

@ -180,7 +180,7 @@ module ActiveRecord
# raw_timestamp_to_cache_version(timestamp) # raw_timestamp_to_cache_version(timestamp)
# # => "20181015200215266505" # # => "20181015200215266505"
# #
# Postgres truncates trailing zeros, # PostgreSQL truncates trailing zeros,
# https://github.com/postgres/postgres/commit/3e1beda2cde3495f41290e1ece5d544525810214 # https://github.com/postgres/postgres/commit/3e1beda2cde3495f41290e1ece5d544525810214
# to account for this we pad the output with zeros # to account for this we pad the output with zeros
def raw_timestamp_to_cache_version(timestamp) def raw_timestamp_to_cache_version(timestamp)

View file

@ -85,14 +85,14 @@ module ActiveRecord
# ==== Options # ==== Options
# #
# [:returning] # [:returning]
# (Postgres-only) An array of attributes to return for all successfully # (PostgreSQL only) An array of attributes to return for all successfully
# inserted records, which by default is the primary key. # inserted records, which by default is the primary key.
# Pass <tt>returning: %w[ id name ]</tt> for both id and name # Pass <tt>returning: %w[ id name ]</tt> for both id and name
# or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL # or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL
# clause entirely. # clause entirely.
# #
# [:unique_by] # [:unique_by]
# (Postgres and SQLite only) By default rows are considered to be unique # (PostgreSQL and SQLite only) By default rows are considered to be unique
# by every unique index on the table. Any duplicate rows are skipped. # by every unique index on the table. Any duplicate rows are skipped.
# #
# To skip rows according to just one unique index pass <tt>:unique_by</tt>. # To skip rows according to just one unique index pass <tt>:unique_by</tt>.
@ -154,7 +154,7 @@ module ActiveRecord
# ==== Options # ==== Options
# #
# [:returning] # [:returning]
# (Postgres-only) An array of attributes to return for all successfully # (PostgreSQL only) An array of attributes to return for all successfully
# inserted records, which by default is the primary key. # inserted records, which by default is the primary key.
# Pass <tt>returning: %w[ id name ]</tt> for both id and name # Pass <tt>returning: %w[ id name ]</tt> for both id and name
# or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL # or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL
@ -202,14 +202,14 @@ module ActiveRecord
# ==== Options # ==== Options
# #
# [:returning] # [:returning]
# (Postgres-only) An array of attributes to return for all successfully # (PostgreSQL only) An array of attributes to return for all successfully
# inserted records, which by default is the primary key. # inserted records, which by default is the primary key.
# Pass <tt>returning: %w[ id name ]</tt> for both id and name # Pass <tt>returning: %w[ id name ]</tt> for both id and name
# or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL # or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL
# clause entirely. # clause entirely.
# #
# [:unique_by] # [:unique_by]
# (Postgres and SQLite only) By default rows are considered to be unique # (PostgreSQL and SQLite only) By default rows are considered to be unique
# by every unique index on the table. Any duplicate rows are skipped. # by every unique index on the table. Any duplicate rows are skipped.
# #
# To skip rows according to just one unique index pass <tt>:unique_by</tt>. # To skip rows according to just one unique index pass <tt>:unique_by</tt>.

View file

@ -41,7 +41,7 @@ module ActiveRecord
column_24 = @connection.columns(:mysql_doubles).find { |c| c.name == "float_24" } column_24 = @connection.columns(:mysql_doubles).find { |c| c.name == "float_24" }
column_25 = @connection.columns(:mysql_doubles).find { |c| c.name == "float_25" } column_25 = @connection.columns(:mysql_doubles).find { |c| c.name == "float_25" }
# Mysql floats are precision 0..24, Mysql doubles are precision 25..53 # MySQL floats are precision 0..24, MySQL doubles are precision 25..53
assert_equal 24, column_no_limit.limit assert_equal 24, column_no_limit.limit
assert_equal 24, column_short.limit assert_equal 24, column_short.limit
assert_equal 53, column_long.limit assert_equal 53, column_long.limit

View file

@ -105,7 +105,7 @@ depending on the purpose of these columns.
fields that Active Record will look for when you create associations between fields that Active Record will look for when you create associations between
your models. your models.
* **Primary keys** - By default, Active Record will use an integer column named * **Primary keys** - By default, Active Record will use an integer column named
`id` as the table's primary key (`bigint` for Postgres and MYSQL, `integer` `id` as the table's primary key (`bigint` for PostgreSQL and MySQL, `integer`
for SQLite). When using [Active Record Migrations](active_record_migrations.html) for SQLite). When using [Active Record Migrations](active_record_migrations.html)
to create your tables, this column will be automatically created. to create your tables, this column will be automatically created.

View file

@ -1206,7 +1206,7 @@ The I18n API described in this guide is primarily intended for translating inter
Several gems can help with this: Several gems can help with this:
* [Globalize](https://github.com/globalize/globalize): Store translations on separate translation tables, one for each translated model * [Globalize](https://github.com/globalize/globalize): Store translations on separate translation tables, one for each translated model
* [Mobility](https://github.com/shioyama/mobility): Provides support for storing translations in many formats, including translation tables, json columns (Postgres), etc. * [Mobility](https://github.com/shioyama/mobility): Provides support for storing translations in many formats, including translation tables, json columns (PostgreSQL), etc.
* [Traco](https://github.com/barsoom/traco): Translatable columns for Rails 3 and 4, stored in the model table itself * [Traco](https://github.com/barsoom/traco): Translatable columns for Rails 3 and 4, stored in the model table itself
Conclusion Conclusion