aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Allow a symbol to be passed to `attribute`, in place of a type objectSean Griffin2015-02-061-0/+4
| | | | | | | | | | | | | | | | | | The same is not true of `define_attribute`, which is meant to be the low level no-magic API that sits underneath. The differences between the two APIs are: - `attribute` - Lazy (the attribute will be defined after the schema has loaded) - Allows either a type object or a symbol - `define_attribute` - Runs immediately (might get trampled by schema loading) - Requires a type object This was the last blocker in terms of public interface requirements originally discussed for this feature back in May. All the implementation blockers have been cleared, so this feature is probably ready for release (pending one more look-over by me).
* rm `Column#cast_type`Sean Griffin2015-02-031-19/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type from the column is never used, except when being passed to the attributes API. While leaving the type on the column wasn't necessarily a bad thing, I worry that it's existence there implies that it is something which should be used. During the design and implementation process of the attributes API, there have been plenty of cases where getting the "right" type object was hard, but I had easy access to the column objects. For any contributor who isn't intimately familiar with the intents behind the type casting system, grabbing the type from the column might easily seem like the "correct" thing to do. As such, the goal of this change is to express that the column is not something that should be used for type casting. The only places that are "valid" (at the time of this commit) uses of acquiring a type object from the column are fixtures (as the YAML file is going to mirror the database more closely than the AR object), and looking up the type during schema detection to pass to the attributes API Many of the failing tests were removed, as they've been made obsolete over the last year. All of the PG column tests were testing nothing beyond polymorphism. The Mysql2 tests were duplicating the mysql tests, since they now share a column class. The implementation is a little hairy, and slightly verbose, but it felt preferable to going back to 20 constructor options for the columns. If you are git blaming to figure out wtf I was thinking with them, and have a better idea, go for it. Just don't use a type object for this.
* Add an `:if_exists` option to `drop_table`Stefan Kanev2015-01-191-1/+1
| | | | | | | | | | | If set to `if_exists: true`, it generates a statement like: DROP TABLE IF EXISTS posts This syntax is supported in the popular SQL servers, that is (at least) SQLite, PostgreSQL, MySQL, Oracle and MS SQL Sever. Closes #16366.
* Refactor `visit_ChangeColumnDefinition`Ryuta Kamizono2015-01-031-10/+8
| | | | `visit_ChangeColumnDefinition` is the same "CHANGE column_name " + `visit_ColumnDefinition(o)`.
* Add default value for `create_table_definition`Ryuta Kamizono2015-01-031-2/+2
| | | | | In most cases, `create_table_definition` called by table_name (the first argument) only.
* Merge pull request #17820 from fw42/restore_query_cache_on_rollbackRafael Mendonça França2015-01-021-1/+1
|\ | | | | | | Clear query cache on rollback
| * Restore query cache on rollbackFlorian Weingarten2014-12-011-1/+1
| |
* | Merge pull request #18228 from kamipo/correctly_dump_primary_keyRafael Mendonça França2015-01-021-0/+12
|\ \ | | | | | | | | | | | | | | | | | | Improve a dump of the primary key support. Conflicts: activerecord/CHANGELOG.md
| * | Improve a dump of the primary key support.Ryuta Kamizono2014-12-291-0/+12
| | | | | | | | | | | | If it is not a default primary key, correctly dump the type and options.
* | | Merge pull request #18067 from ↵Rafael Mendonça França2015-01-021-0/+28
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/format_datetime_string_according_to_precision Format the datetime string according to the precision of the datetime field. Conflicts: activerecord/CHANGELOG.md
| * | | Format the datetime string according to the precision of the datetime field.Ryuta Kamizono2015-01-021-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incompatible to rounding behavior between MySQL 5.6 and earlier. In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`: http://bugs.mysql.com/bug.php?id=68760
| * | | Allow precision option for MySQL datetimes.Ryuta Kamizono2015-01-021-0/+12
|/ / /