diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2017-01-15 20:08:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-15 20:08:02 +0100 |
commit | 0bc8d0fb88101a7ea5f87df5f5b384746e3cf06e (patch) | |
tree | d4d3f8898ce9d551bbff00fa68559224d515ef76 /activerecord/lib/active_record/migration | |
parent | 7c3a99eeca07f602bb1e5659656e8eab0a4eacfe (diff) | |
parent | c352f12cbb75636380b06917616e14029f339189 (diff) | |
download | rails-0bc8d0fb88101a7ea5f87df5f5b384746e3cf06e.tar.gz rails-0bc8d0fb88101a7ea5f87df5f5b384746e3cf06e.tar.bz2 rails-0bc8d0fb88101a7ea5f87df5f5b384746e3cf06e.zip |
Merge pull request #27618 from kamipo/fix_uuid_default_nil
Fix UUID primary key with default nil in legacy migration
Diffstat (limited to 'activerecord/lib/active_record/migration')
-rw-r--r-- | activerecord/lib/active_record/migration/compatibility.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration/compatibility.rb b/activerecord/lib/active_record/migration/compatibility.rb index 2904634eb7..a5d8893634 100644 --- a/activerecord/lib/active_record/migration/compatibility.rb +++ b/activerecord/lib/active_record/migration/compatibility.rb @@ -16,7 +16,7 @@ module ActiveRecord class V5_0 < V5_1 def create_table(table_name, options = {}) if adapter_name == "PostgreSQL" - if options[:id] == :uuid && !options[:default] + if options[:id] == :uuid && !options.key?(:default) options[:default] = "uuid_generate_v4()" end end |