diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/5_0_release_notes.md | 6 | ||||
-rw-r--r-- | guides/source/active_record_migrations.md | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/guides/source/5_0_release_notes.md b/guides/source/5_0_release_notes.md index 6351ff57c1..28f653b634 100644 --- a/guides/source/5_0_release_notes.md +++ b/guides/source/5_0_release_notes.md @@ -585,6 +585,9 @@ Please refer to the [Changelog][active-record] for detailed changes. * Added ActiveRecord `#second_to_last` and `#third_to_last` methods. ([Pull Request](https://github.com/rails/rails/pull/23583)) +* Added ability to annotate database objects (tables, columns, indexes) + with comments stored in database metadata for PostgreSQL & MySQL. + ([Pull Request](https://github.com/rails/rails/pull/22911)) Active Model ------------ @@ -821,6 +824,9 @@ Please refer to the [Changelog][active-support] for detailed changes. application code, and the application reloading process. ([Pull Request](https://github.com/rails/rails/pull/23807)) +* `ActiveSupport::Duration` now supports ISO8601 formatting and parsing. + ([Pull Request](https://github.com/rails/rails/pull/16917)) + Credits ------- diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index b89485b945..f914122242 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -247,6 +247,7 @@ end ``` This migration will create a `user_id` column and appropriate index. +For more `add_reference` options, visit the [API documentation](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_reference). There is also a generator which will produce join tables if `JoinTable` is part of the name: @@ -355,6 +356,13 @@ end will append `ENGINE=BLACKHOLE` to the SQL statement used to create the table (when using MySQL or MariaDB, the default is `ENGINE=InnoDB`). +Also you can pass the `:comment` option with any description for the table +that will be stored in database itself and can be viewed with database administration +tools, such as MySQL Workbench or PgAdmin III. It's highly recommended to specify +comments in migrations for applications with large databases as it helps people +to understand data model and generate documentation. +Currently only the MySQL and PostgreSQL adapters support comments. + ### Creating a Join Table The migration method `create_join_table` creates an HABTM (has and belongs to @@ -454,6 +462,7 @@ number of digits after the decimal point. are using a dynamic value (such as a date), the default will only be calculated the first time (i.e. on the date the migration is applied). * `index` Adds an index for the column. +* `comment` Adds a comment for the column. Some adapters may support additional options; see the adapter specific API docs for further information. |