aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | TEXT and BLOB limit is byte length, not character length.Ryuta Kamizono2015-09-111-2/+2
| |/ / / /
* / / / / Updated MySQL documentation link to MySQL latest version 5.7 everywhere [ci ↵amitkumarsuroliya2015-09-101-2/+2
|/ / / / | | | | | | | | | | | | | | | | skip] Bumps from `5.6` to `5.7`
* | | | No need to get the exception variableRafael Mendonça França2015-09-011-6/+4
| | | |
* | | | Merge pull request #21318 from yahonda/pr21108Rafael Mendonça França2015-09-011-2/+6
|\ \ \ \ | | | | | | | | | | Support MySQL 5.7.8 which enables show_compatibility_56=off
| * | | | Support MySQL 5.7.8 which enables show_compatibility_56=offYasuo Honda2015-08-211-2/+6
| | | | |
* | | | | JSON is still an adapter specific type.Sean Griffin2015-08-211-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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?
* | | | Add a native JSON data type support in MySQLRyuta Kamizono2015-08-181-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Ensure that microsecond precision is only used for version of mysql that ↵Jori Hardman2015-07-201-5/+13
| | | | | | | | | | | | | | | | support it. Fixes #19711
* | | | Add reversible syntax for change_column_defaultPrem Sichanugrist2015-06-261-1/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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")
* | | If specify `strict: :default` explicitly, do not set sql_mode.Ryuta Kamizono2015-05-261-2/+4
| | | | | | | | | | | | Related with #17370.
* | | Remove `require 'arel/visitors/bind_visitor'`Ryuta Kamizono2015-05-191-1/+0
| | | | | | | | | | | | | | | This line introduced by the commit fd398475 for using `Arel::Visitors::BindVisitor`. Currently it is not used.
* | | Divide methods for handling column options separatelyRyuta Kamizono2015-05-181-6/+10
| | |
* | | Refactor abstract_mysql_adapter type_to_sql methodMehmet Emin İNAÇ2015-05-131-21/+33
| | |
* | | Merge pull request #20047 from mcfiredrill/make-subquery-for-privateRafael Mendonça França2015-05-061-13/+13
|\ \ \ | | | | | | | | make AbstractAdapter#subquery_for private
| * | | make AbstractAdapter#subquery_for privateTony Miller2015-05-061-13/+13
| | | |
* | | | More exercise the create index sql testsRyuta Kamizono2015-05-041-2/+3
| | | |
* | | | Do not use options that does not supportRyuta Kamizono2015-05-041-4/+4
| | | | | | | | | | | | | | | | | | | | MySQL does not support partial index. And, the create index algorithm in create table can not be specified.
* | | | Merge pull request #17569 from kamipo/dump_table_optionsRafael Mendonça França2015-05-031-0/+10
|\ \ \ \ | | | | | | | | | | | | | | | Correctly dump `:options` on `create_table` for MySQL
| * | | | Correctly dump `:options` on `create_table` for MySQLRyuta Kamizono2015-05-031-0/+10
| | | | |
* | | | | Merge pull request #19978 from kamipo/collation_option_support_for_postgresqlRafael Mendonça França2015-05-031-20/+17
|\ \ \ \ \ | | | | | | | | | | | | PostgreSQL: `:collation` support for string and text columns
| * | | | | Move the collation handling code from the MySQL adapter to common classesRyuta Kamizono2015-05-041-20/+17
| | |/ / / | |/| | | | | | | | | | | | | | | | | | Some databases like MySQL allow defining collation charset for specific columns.
* / | | | Change the `visit_AddColumn` visiblity for the internal APIRyuta Kamizono2015-05-031-5/+5
|/ / / /
* / / / :nodoc: change_column_null in the implmenting adaptersTony Miller2015-05-031-1/+1
|/ / / | | | | | | | | | | | | | | | `change_column_null` is doc'ed only in ActiveRecord::ConnectionAdapters::SchemaStatements, so it would make sense to :nodoc: it elsewhere.
* | | Merge pull request #17574 from kamipo/charset_collation_optionsJeremy Kemper2015-04-071-0/+38
|\ \ \ | | | | | | | | | | | | Add charset and collation options support for MySQL string and text columns.
| * | | Add `:charset` and `:collation` options support for MySQL string and text ↵Ryuta Kamizono2015-03-061-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | columns Example: create_table :foos do |t| t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' t.text :text_ascii, charset: 'ascii' end
* | | | No need to document drop_table in the PostgreSQLAdapterRafael Mendonça França2015-04-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | It behaves in the same way that the abstract adapter. [ci skip]
* | | | change the explanation of :if_exists option [ci skip]Mehmet Emin İNAÇ2015-04-061-1/+1
| | | |
* | | | drop_table method documentation for mysql and postgresql adapters [ci skip]Mehmet Emin İNAÇ2015-04-061-0/+11
| | | |
* | | | Merge pull request #19449 from Gaurav2728/gaurav-unavailable_linkRafael Mendonça França2015-03-231-2/+1
|\ \ \ \ | | | | | | | | | | remove old unavailable link with relevant fix patch 1
| * | | | remove old unavailable link with relevant fixGaurav Sharma2015-03-231-2/+1
| | | | |
* | | | | update mysql link that has been replacedGaurav Sharma2015-03-231-1/+1
|/ / / /
* | | | Updated MySQL documentation link to MySQL latest version 5.6 everywhere [ci ↵amitkumarsuroliya2015-03-191-2/+2
| | | | | | | | | | | | | | | | skip]
* | | | Materialize subqueries by adding `DISTINCT`Yasuo Honda2015-03-161-1/+3
|/ / / | | | | | | | | | to support MySQL 5.7.6 `optimizer_switch='derived_merge=on'`
* / / Add `Column#bigint?` methodRyuta Kamizono2015-03-041-2/+2
|/ /
* | Add `SchemaMigration.create_table` support any unicode charsets for MySQL.Ryuta Kamizono2015-02-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | +--------------------+----------------------+------------------+--------+
* | Fix mysql's schema.rb dumper so it does not include limit on emulated ↵Court3nay2015-02-241-0/+1
| | | | | | | | boolean tinyint(1) fields
* | Move back `new_column_definition` into `TableDefinition`Ryuta Kamizono2015-02-251-4/+4
| | | | | | | | | | | | | | | | | | Only `primary_key` should be extracted by d47357e in #19030, but `new_coclumn_definition` was also extracted because #17631 is merged previously, then #19030 is auto merged without conflicts. This commit is for move back `new_column_definition` into `TableDefinition`.
* | Merge pull request #19030 from kamipo/extract_short_hand_column_methodsRafael Mendonça França2015-02-231-3/+15
|\ \ | | | | | | Extract the short-hand column methods into `ColumnMethods`
| * | Extract `primary_key` method into `ColumnMethods`Ryuta Kamizono2015-02-221-3/+15
| | |
* | | Allow `:limit` option for MySQL bigint primary key supportRyuta Kamizono2015-02-241-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Example: create_table :foos, id: :primary_key, limit: 8 do |t| end # or create_table :foos, id: false do |t| t.column :id, limit: 8 end
* | Format the time string according to the precision of the time columnRyuta Kamizono2015-02-201-2/+2
| | | | | | | | It is also necessary to format a time column like a datetime column.
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-201-7/+4
| |
* | `type_cast_for_database` -> `serialize`Sean Griffin2015-02-171-1/+1
| |
* | Revert "Allow `:precision` option for time type columns"Sean Griffin2015-02-171-4/+7
| | | | | | | | | | | | | | | | | | | | This reverts commit 1502caefd30b137fd1a0865be34c5bbf85ba64c1. The test suite for the mysql adapter broke when this commit was used with MySQL 5.6. Conflicts: activerecord/CHANGELOG.md
* | Register adapter specific types with the global type registrySean Griffin2015-02-151-3/+2
| | | | | | | | | | | | We do this in the adapter classes specifically, so the types aren't registered if we don't use that adapter. Constants under the PostgreSQL namespace for example are never loaded if we're using mysql.
* | Allow `:precision` option for time type columnsRyuta Kamizono2015-02-121-7/+4
| |
* | The datetime precision with zero should be dumpedRyuta Kamizono2015-02-111-0/+6
| | | | | | | | | | `precision: 0` was not dumped by f1a0fa9e19b7e4ccaea191fc6cf0613880222ee7. However, `precision: 0` is valid value for PostgreSQL timestamps.
* | Refactor microsecond precision to be database agnosticSean Griffin2015-02-101-14/+9
| | | | | | | | | | | | | | | | | | | | The various databases don't actually need significantly different handling for this behavior, and they can achieve it without knowing about the type of the object. The old implementation was returning a string, which will cause problems such as breaking TZ aware attributes, and making it impossible for the adapters to supply their logic for time objects.
* | Fix rounding problem for PostgreSQL timestamp columnRyuta Kamizono2015-02-081-12/+4
| | | | | | | | | | If timestamp column have the precision, it need to format according to the precision of timestamp column.
* | Add `auto_increment?` instead of `extra == 'auto_increment'`Ryuta Kamizono2015-02-081-2/+6
| |