aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql2/schema_migrations_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Avoid extra `show variables` in migrationRyuta Kamizono2016-02-011-5/+0
| | | | | | | | | | | | | `initialize_schema_migrations_table` is called in every migrations. https://github.com/rails/rails/blob/v5.0.0.beta1/activerecord/lib/active_record/migration.rb#L1080 https://github.com/rails/rails/blob/v5.0.0.beta1/activerecord/lib/active_record/schema.rb#L51 This means that extra `show variables` is called regardless of the existence of `schema_migrations` table. This change is to avoid extra `show variables` if `schema_migrations` table exists.
* [close #23009] Limit key lengthschneems2016-01-211-7/+29
| | | | | | | Mysql has a weird bug where it cannot index a string column of utf8mb4 if it is over a certain character limit. To get compatibility with msql we can add a limit to the key column. 191 characters is a very long key, it seems reasonable to limit across all adapters since using a longer key wouldn't be supported in mysql. Thanks to @kamipo for the original PR and the test refactoring. Conversation: https://github.com/rails/rails/pull/23009#issuecomment-171416629
* make it possible to run AR tests with bin/testYves Senn2015-06-111-43/+38
|
* Add `SchemaMigration.create_table` support any unicode charsets for MySQL.Ryuta Kamizono2015-02-261-2/+2
| | | | | | | | | | | | | | | | | 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 | +--------------------+----------------------+------------------+--------+
* Respect the database default charset for `schema_migrations` table.Ryuta Kamizono2015-02-081-4/+12
| | | | | | The charset of `version` column in `schema_migrations` table is depend on the database default charset and collation rather than the encoding of the connection.
* tests, use `drop_table if_exists: true` in our test suite.Yves Senn2015-01-201-1/+1
|
* use foreign key DSL in our tests.Yves Senn2014-07-161-2/+2
|
* `rename_index`: add the new index before removing the old one.Yves Senn2013-11-261-6/+19
| | | | | | | | | | | This prevents the following error when a MySQL index on a foreign key column is renamed: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint: DROP INDEX `index_engines_on_car_id` ON `engines` ``` refs: #13038.
* sets limit 191 for schema_migrations#version in mysql2 if the encoding is ↵Xavier Noria2013-03-171-0/+26
"utf8mb4" Please, see rationale in the included CHANGELOG patch.