aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/mysql/column.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Virtual/generated column support for MySQL 5.7.5+ and MariaDB 5.2.0+Ryuta Kamizono2017-02-011-0/+4
| | | | | | | | | | | | | | | | | | | MySQL generated columns: https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html MariaDB virtual columns: https://mariadb.com/kb/en/mariadb/virtual-computed-columns/ Declare virtual columns with `t.virtual name, type: …, as: "expression"`. Pass `stored: true` to persist the generated value (false by default). Example: create_table :generated_columns do |t| t.string :name t.virtual :upper_name, type: :string, as: "UPPER(name)" t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true t.index :name_length # May be indexed, too! end Closes #22589
* Simplify the regex for `unsigned?` methodRyuta Kamizono2016-12-111-2/+1
| | | | | It is enough to distinguish only the trailing `unsigned` and `unsigned zerofill`.
* [ci skip] Document regex changeAlex Kitchens2016-12-061-0/+1
|
* Fix that unsigned with zerofill is treated as signedRyuta Kamizono2016-11-271-1/+1
| | | | Fixes #27125.
* Use Regexp#match? rather than Regexp#===Ryuta Kamizono2016-10-261-2/+2
| | | | Follow up to 99cf7558000090668b137085bfe6bcc06c4571dc.
* Remove unused `blob_or_text_column?` methodRyuta Kamizono2016-08-191-4/+0
|
* Remove text default treated as an empty string in non-strict modeRyuta Kamizono2016-08-191-19/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strict mode controls how MySQL handles invalid or missing values in data-change statements such as INSERT or UPDATE. If strict mode is not in effect, MySQL inserts adjusted values for invalid or missing values and produces warnings. ```ruby def test_mysql_not_null_defaults_non_strict using_strict(false) do with_mysql_not_null_table do |klass| record = klass.new assert_nil record.non_null_integer assert_nil record.non_null_string assert_nil record.non_null_text assert_nil record.non_null_blob record.save! record.reload assert_equal 0, record.non_null_integer assert_equal "", record.non_null_string assert_equal "", record.non_null_text assert_equal "", record.non_null_blob end end end ``` It is inconsistent with other types that only text/blob defaults treated as an empty string. This commit fixes the inconsistency.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-4/+4
|
* applies new string literal convention in activerecord/libXavier Noria2016-08-061-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove unnecessary `assert_valid_default`Ryuta Kamizono2016-06-251-7/+0
| | | | | This was added at c7c3f73 but it never raised because MySQL cannot create text/blob columns with a default value.
* Extract `MySQL::Column` class to `connection_adapters/mysql/column.rb`Ryuta Kamizono2016-01-111-0/+50