diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-25 10:11:31 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-10-25 18:11:22 +0900 |
commit | a2ad8f456e29f760f78333e14474868a63a22a6f (patch) | |
tree | 1f3ce3dd0c1387a4a083e444527f8f1c6de8f861 /activerecord/test/schema | |
parent | d496055b5b75387136bcdd1cc93aeab14dbda606 (diff) | |
download | rails-a2ad8f456e29f760f78333e14474868a63a22a6f.tar.gz rails-a2ad8f456e29f760f78333e14474868a63a22a6f.tar.bz2 rails-a2ad8f456e29f760f78333e14474868a63a22a6f.zip |
Support default expression for MySQL
MySQL 8.0.13 and higher supports default value to be a function or
expression.
https://dev.mysql.com/doc/refman/8.0/en/create-table.html
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/mysql2_specific_schema.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/schema/mysql2_specific_schema.rb b/activerecord/test/schema/mysql2_specific_schema.rb index 499280cb0c..ccca9a2d9b 100644 --- a/activerecord/test/schema/mysql2_specific_schema.rb +++ b/activerecord/test/schema/mysql2_specific_schema.rb @@ -19,6 +19,9 @@ ActiveRecord::Schema.define do t.datetime :fixed_time, default: "2004-01-01 00:00:00" t.column :char1, "char(1)", default: "Y" t.string :char2, limit: 50, default: "a varchar field" + if supports_default_expression? + t.binary :uuid, limit: 36, default: -> { "(uuid())" } + end end create_table :binary_fields, force: true do |t| |