| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Example:
create_table :foos do |t|
t.integer :unsigned_integer, unsigned: true
t.bigint :unsigned_bigint, unsigned: true
t.float :unsigned_float, unsigned: true
t.decimal :unsigned_decimal, unsigned: true, precision: 10, scale: 2
end
|
|\ \ \
| | | |
| | | |
| | | | |
Move `explain` into `AbstractMysqlAdapter`
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Common methods in both mysql adapters are should be added to
`AbstractMysqlAdapter`, but some methods had been added to
`Mysql2Adapter`. (8744632f, 0306f82e, #14359)
Some methods already moved from `Mysql2Adapter` to
`AbstractMysqlAdapter`. (#17601, #17998)
Common methods in both mysql adapters are remaining only the `explain`
method in `Mysql2Adapter`.
|
|\ \ \ \
| | | | |
| | | | | |
Fix undesired type lookup with `SET` in MySQL
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit fixes the following problems:
* cause infinit type lookup loop when SET includes aliased types
* For example:
when SET('set') includes aliased type `set`,
then aliased `varchar('set')` by type lookup,
but type lookup infinit matching same rule.
* cause type lookup miss when SET includes registered types
* For example:
when SET('time') includes registered type `time`,
then aliased `varchar('time')` by type lookup,
then matching `time` type.
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
kamipo/eliminate_duplicated_visit_table_definition
Eliminate the duplication code of `visit_TableDefinition`
|
| | |_|/ /
| |/| | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | | |
Do not dump a view as a table in sqlite3, mysql and mysql2 adapters
|
| |/ / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Remove unnecessary display width
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The **(11)** does not affect the storage size of the data type, which for an
INT will always be 4 bytes. It affects the **display width**.
http://www.tocker.ca/2015/07/02/proposal-to-deprecate-mysql-integer-display-width-and-zerofill.html
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Reduce the calling `create_table_info` query
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Currently in schema dumping, `create_table_info` query is called twice
for each tables. It means if 100 tables exists, the query is called 200
times. This change is that the query is called once for each tables in
schema dumping.
|
| |/ / / /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Example:
create_table :barcodes, primary_key: ["region", "code"] do |t|
t.string :region
t.integer :code
end
|
|\ \ \ \ \
| | | | | |
| | | | | | |
TEXT and BLOB limit is byte length, not character length.
|
| |/ / / / |
|
|/ / / /
| | | |
| | | |
| | | |
| | | | |
skip]
Bumps from `5.6` to `5.7`
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Support MySQL 5.7.8 which enables show_compatibility_56=off
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Several changes were made in #21110 which I am strongly opposed to.
(this is what I get for going on vacation. :trollface:) No type should
be introduced into the generic `ActiveRecord::Type` namespace, and
*certainly* should not be registered into the registry unconstrained
unless it is supported by *all* adapters (which basically means that it
was specified in the ANSI SQL standard).
I do not think `# :nodoc:` ing the type is sufficient, as it still makes
the code of Rails itself very unclear as to what the role of that class
is. While I would argue that this shouldn't even be a super class, and
that MySql and PG's JSON types are only superficially duplicated (they
might look the same but will change for different reasons in the
future).
However, I don't feel strongly enough about it as a point of contention
(and the biggest cost of harming the blameability has already occured),
so I simply moved the superclass into a namespace where its role is
absolutely clear.
After this change, `attribute :foo, :json` will once again work with
MySQL and PG, but not with Sqlite3 or any third party adapters.
Unresolved questions
--------------------
The types that and adapter publishes (at least those are unique to that
adapter, and not adding additional behavior like `MysqlString` should
probably be part of the adapter's public API. Should we standardize the
namespace for these, and document them?
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As of MySQL 5.7.8, MySQL supports a native JSON data type.
Example:
create_table :json_data_type do |t|
t.json :settings
end
|
| | | |
| | | |
| | | |
| | | | |
support it. Fixes #19711
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Passing `:from` and `:to` to `change_column_default` makes this command
reversible as user has defined its previous state.
So, instead of having the migration command as:
change_column_default(:posts, :state, "draft")
They can write it as:
change_column_default(:posts, :state, from: nil, to: "draft")
|
| | |
| | |
| | |
| | | |
Related with #17370.
|
| | |
| | |
| | |
| | |
| | | |
This line introduced by the commit fd398475 for using
`Arel::Visitors::BindVisitor`. Currently it is not used.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
make AbstractAdapter#subquery_for private
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
MySQL does not support partial index. And, the create index algorithm in
create table can not be specified.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Correctly dump `:options` on `create_table` for MySQL
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
PostgreSQL: `:collation` support for string and text columns
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
Some databases like MySQL allow defining collation charset for specific
columns.
|
|/ / / / |
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
`change_column_null` is doc'ed only in
ActiveRecord::ConnectionAdapters::SchemaStatements, so it would make
sense to :nodoc: it elsewhere.
|
|\ \ \
| | | |
| | | |
| | | | |
Add charset and collation options support for MySQL string and text columns.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
columns
Example:
create_table :foos do |t|
t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin'
t.text :text_ascii, charset: 'ascii'
end
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It behaves in the same way that the abstract adapter.
[ci skip]
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
remove old unavailable link with relevant fix patch 1
|
| | | | | |
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | | |
skip]
|
|/ / /
| | |
| | |
| | | |
to support MySQL 5.7.6 `optimizer_switch='derived_merge=on'`
|
|/ / |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
MySQL unicode support is not only `utf8mb4`.
Then, The index length problem is not only `utf8mb4`.
http://dev.mysql.com/doc/refman/5.6/en/charset-unicode.html
SELECT * FROM information_schema.character_sets WHERE maxlen > 3;
+--------------------+----------------------+------------------+--------+
| CHARACTER_SET_NAME | DEFAULT_COLLATE_NAME | DESCRIPTION | MAXLEN |
+--------------------+----------------------+------------------+--------+
| utf8mb4 | utf8mb4_general_ci | UTF-8 Unicode | 4 |
| utf16 | utf16_general_ci | UTF-16 Unicode | 4 |
| utf16le | utf16le_general_ci | UTF-16LE Unicode | 4 |
| utf32 | utf32_general_ci | UTF-32 Unicode | 4 |
+--------------------+----------------------+------------------+--------+
|