| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Refactor of #22911.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
| |
|
|\
| |
| |
| | |
Primary key should be `NOT NULL`
|
| |
| |
| |
| |
| |
| |
| | |
Follow up to #18228.
In MySQL and PostgreSQL, primary key is to be `NOT NULL` implicitly.
But in SQLite it must be specified `NOT NULL` explicitly.
|
| |
| |
| |
| |
| |
| | |
* Switch to keyword args where we can without breaking compat.
* Use add_table_options! for :options, too.
* Some code polish.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Comments are specified in migrations, stored in database itself (in its schema),
and dumped into db/schema.rb file.
This allows to generate good documentation and explain columns and tables' purpose
to everyone from new developers to database administrators.
For PostgreSQL and MySQL only. SQLite does not support comments at the moment.
See docs for PostgreSQL: http://www.postgresql.org/docs/current/static/sql-comment.html
See docs for MySQL: http://dev.mysql.com/doc/refman/5.7/en/create-table.html
|
| |
| |
| |
| | |
`MysqlString`
|
| |
| |
| |
| | |
methods to `Quoting` module
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
Extract `default_primary_key?` to refactor `column_spec_for_primary_key`
|
| | |
|
|/
|
|
|
|
|
|
| |
working
Currently the results of `column.serial?` is not correct. For
`column.serial?` correctly working, initialize `column.table_name`
immediately.
|
| |
|
|
|
|
| |
Actually `:name` and `:type` are not column options.
|
|
|
|
|
|
|
|
|
| |
A return value of `schema_type` is used by:
1. primary key type: using as `symbol.inspect`
2. normal column type: using as `symbol.to_s`
It is better to return symbol.
|
| |
|
|
|
|
| |
`connection_adapters/mysql/type_metadata.rb`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Pg and Sqlite3, `:text` and `:binary` have variable unlimited length.
But in MySQL, these have limited length for each types (ref #21591, #21619).
This change adds short-hand methods for each text and blob types.
Example:
create_table :foos do |t|
t.tinyblob :tiny_blob
t.mediumblob :medium_blob
t.longblob :long_blob
t.tinytext :tiny_text
t.mediumtext :medium_text
t.longtext :long_text
end
|
|
|
|
| |
Such as #10404, #18206.
|
|
|
|
|
|
| |
Currently `tinyblob` is dumped to `t.binary "tiny_blob", limit: 255`.
But `t.binary ... limit: 255` is generating SQL to `varchar(255)`.
It is incorrect. This commit fixes this problem.
|
|
|
|
|
| |
Current master branch includes many schema dumping improvements.
It extract these features to the appropriate files.
|
|
|
|
|
| |
Current master branch includes many schema creation improvements in
MySQL. It extract these features to the appropriate file.
|
|
Current master branch includes many schema definition improvements in
MySQL. It extract these features to the appropriate file.
|