Skip to content

Commit d77a49c

Browse files
committed
Add some description for MariaDB in ActiveRecord documentation
This enhancement aims to improve the accuracy and completeness of the documentation, providing users with comprehensive guidance across different database platforms. The changes ensure that users are aware of MariaDB compatibility for primary key column type, explain options, and information about multiple column indexes.
1 parent 89adf24 commit d77a49c

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

guides/source/active_record_basics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ Active Record uses conventions for column names in the database tables as well,
130130
depending on the purpose of these columns.
131131

132132
* **Primary keys** - By default, Active Record will use an integer column named
133-
`id` as the table's primary key (`bigint` for PostgreSQL and MySQL, `integer`
134-
for SQLite). When using [Active Record Migrations](#migrations) to create your
135-
tables, this column will be automatically created.
133+
`id` as the table's primary key (`bigint` for PostgreSQL, MySQL, and MariaDB,
134+
`integer` for SQLite). When using [Active Record Migrations](#migrations) to
135+
create your tables, this column will be automatically created.
136136
* **Foreign keys** - These fields should be named following the pattern
137137
`singularized_table_name_id` (e.g., `order_id`, `line_item_id`). These are the
138138
fields that Active Record will look for when you create associations between
@@ -657,8 +657,8 @@ class CreatePublications < ActiveRecord::Migration[7.2]
657657
end
658658
```
659659

660-
Note that the above code is database-agnostic: it will run in MySQL, PostgreSQL,
661-
SQLite, and others.
660+
Note that the above code is database-agnostic: it will run in MySQL, MariaDB,
661+
PostgreSQL, SQLite, and others.
662662

663663
Rails keeps track of which migrations have been committed to the database and
664664
stores them in a neighboring table in that same database called

guides/source/active_record_querying.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2714,7 +2714,7 @@ and may yield this for PostgreSQL:
27142714

27152715
### Explain Options
27162716

2717-
For databases and adapters which support them (currently PostgreSQL and MySQL), options can be passed to provide deeper analysis.
2717+
For databases and adapters which support them (currently PostgreSQL, MySQL, and MariaDB), options can be passed to provide deeper analysis.
27182718

27192719
Using PostgreSQL, the following:
27202720

guides/source/active_record_validations.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,9 @@ In order to add a uniqueness database constraint on your database, use the
762762

763763
Should you wish to create a database constraint to prevent possible violations
764764
of a uniqueness validation using the `:scope` option, you must create a unique
765-
index on both columns in your database. See [the MySQL manual][] for more
766-
details about multiple column indexes or [the PostgreSQL manual][] for examples
767-
of unique constraints that refer to a group of columns.
765+
index on both columns in your database. See [the MySQL manual][] and [the MariaDB
766+
manual][] for more details about multiple column indexes, or [the PostgreSQL
767+
manual][] for examples of unique constraints that refer to a group of columns.
768768

769769
There is also a `:case_sensitive` option that you can use to define whether the
770770
uniqueness constraint will be case sensitive, case insensitive, or if it should
@@ -791,6 +791,7 @@ See [`validates_uniqueness_of`][] for more information.
791791
[`validates_uniqueness_of`]: https://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_uniqueness_of
792792
[`add_index`]: https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index
793793
[the MySQL manual]: https://dev.mysql.com/doc/refman/en/multiple-column-indexes.html
794+
[the MariaDB manual]: https://mariadb.com/kb/en/compound-composite-indexes/
794795
[the PostgreSQL manual]: https://www.postgresql.org/docs/current/static/ddl-constraints.html
795796

796797
### `validates_associated`

0 commit comments

Comments
 (0)