aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema/mysql2_specific_schema.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Layout/EmptyLinesAroundBlockBody` to reduce review cost in the futureRyuta Kamizono2018-07-121-1/+0
| | | | | | | We sometimes ask "✂️ extra blank lines" to a contributor in reviews like https://github.com/rails/rails/pull/33337#discussion_r201509738. It is preferable to deal automatically without depending on manpower.
* Subsecond precision is not supported until MySQL 5.6.4Ryuta Kamizono2018-07-091-6/+6
|
* Fix default value for mysql time types with specified precisionNikolay Kondratyev2018-07-041-0/+2
| | | | | | | | | | | | | | | | The TIME, DATETIME, and TIMESTAMP types [have supported](https://mariadb.com/kb/en/library/microseconds-in-mariadb/) a fractional seconds precision from 0 to 6. Default values from time columns with specified precision is read as `current_timestamp(n)` from information schema. rake `db:schema:dump` produces `schema.rb` **without** default values for time columns with the specified precision: t.datetime "last_message_at", precision: 6, null: false rake `db:schema:dump` produces `schema.rb` **with** default values for time columns with the specified precision: t.datetime "last_message_at", precision: 6, default: -> { "current_timestamp(6)" }, null: false
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Correctly dump native timestamp types for MySQLRyuta Kamizono2017-02-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native timestamp type in MySQL is different from datetime type. Internal representation of the timestamp type is UNIX time, This means that timestamp columns are affected by time zone. ``` > SET time_zone = '+00:00'; Query OK, 0 rows affected (0.00 sec) > INSERT INTO time_with_zone(ts,dt) VALUES (NOW(),NOW()); Query OK, 1 row affected (0.02 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 22:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) > SET time_zone = '-08:00'; Query OK, 0 rows affected (0.00 sec) > SELECT * FROM time_with_zone; +---------------------+---------------------+ | ts | dt | +---------------------+---------------------+ | 2016-02-07 14:11:44 | 2016-02-07 22:11:44 | +---------------------+---------------------+ 1 row in set (0.00 sec) ```
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-8/+8
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* The BINARY Operator is only needed for string columnsRyuta Kamizono2016-02-221-0/+1
| | | | Follow up to #13040.
* Use `t.index` in `create_table` instead of `add_index` in test schemaRyuta Kamizono2016-01-311-5/+4
| | | | For reduce bootstrap queries in tests.
* Fix `bigint?` for Enum columns in MySQLRyuta Kamizono2016-01-311-1/+1
| | | | Follow up to #22896.
* Fix extract default with CURRENT_TIMESTUMPRyuta Kamizono2016-01-131-0/+7
|
* Add short-hand methods for text and blob types in MySQLRyuta Kamizono2016-01-051-10/+10
| | | | | | | | | | | | | | | | | 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
* Fix `unsigned?` and `blob_or_text_column?` for Enum columns in MySQLRyuta Kamizono2016-01-041-1/+1
|
* Merge pull request #21932 from kamipo/add_stored_procedure_test_in_mysql2Sean Griffin2015-10-201-0/+11
|\ | | | | Add stored procedure test in mysql2
| * Add stored procedure test in mysql2Ryuta Kamizono2015-10-151-0/+11
| |
* | Fix to correctly schema dump the `tinyblob`Ryuta Kamizono2015-10-151-1/+1
|/ | | | | | 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.
* Add `:charset` and `:collation` options support for MySQL string and text ↵Ryuta Kamizono2015-03-061-9/+5
| | | | | | | | | | | columns Example: create_table :foos do |t| t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' t.text :text_ascii, charset: 'ascii' end
* tests, favor `drop_table` and `:if_exists` over raw SQL.Yves Senn2015-03-021-6/+2
| | | | | We've replaced most querues using DROP TABLE in our tests already. This patch replaces the last couple calls.
* fix detect column type of enummasarakki2013-04-011-1/+1
| | | | enum includes text or blob or ... hooked by wrong regex
* Add support for FULLTEXT and SPATIAL indexes using the :type flag for MySQL.Ken Mazaika2013-03-271-0/+10
|
* Use the MySQL varbinary type when appropriate in migrations.Victor Costan2012-10-271-9/+13
|
* fix: limit of enum columns of mysqlYamada Masaki2012-06-281-0/+9
|
* Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931.kennyj2012-02-261-2/+2
|
* Only use LOWER for mysql case insensitive uniqueness check when column has a ↵Joseph Palermo2011-10-091-1/+12
| | | | case sensitive collation.
* update tests for mysql2 supportBrian Lopez2010-08-021-0/+24