diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-16 14:03:28 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-16 22:19:47 -0700 |
commit | 3b0a627a94cca3a77568703e2053805b5a7ff807 (patch) | |
tree | 924e3e10bb5ea2416c08b936a9aa9d1ae641b960 /guides/source | |
parent | 4c4dd06aa6d6aaa55bd56eac1c439f944b6733d1 (diff) | |
parent | c690b9ce39c893077b48fa5b27af87e995f97e9b (diff) | |
download | rails-3b0a627a94cca3a77568703e2053805b5a7ff807.tar.gz rails-3b0a627a94cca3a77568703e2053805b5a7ff807.tar.bz2 rails-3b0a627a94cca3a77568703e2053805b5a7ff807.zip |
Merge pull request #22911 from Envek/database_comments
Add support for specifying comments for tables, columns, and indexes in database itself
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/active_record_migrations.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index 004a30d669..2aae35223a 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -356,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 MySQL and PostgreSQL supports comments. + ### Creating a Join Table The migration method `create_join_table` creates an HABTM (has and belongs to @@ -455,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. |