aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2014-12-26 17:45:12 +0900
committerRyuta Kamizono <kamipo@gmail.com>2014-12-26 17:54:08 +0900
commit9b3e7b396eab9914ba96c0b8a3b3cbbdd35c0361 (patch)
tree04fd53cfb3640fc138d3f7801f0e64cd1cff4bf8 /activerecord/test/cases/adapters/postgresql
parent5fed875e908ba5fd78c19c8977b0bba5f660e992 (diff)
downloadrails-9b3e7b396eab9914ba96c0b8a3b3cbbdd35c0361.tar.gz
rails-9b3e7b396eab9914ba96c0b8a3b3cbbdd35c0361.tar.bz2
rails-9b3e7b396eab9914ba96c0b8a3b3cbbdd35c0361.zip
Dump the default `nil` for PostgreSQL UUID primary key.
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql')
-rw-r--r--activerecord/test/cases/adapters/postgresql/uuid_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
index d6deb6fb1f..3c967d73da 100644
--- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
@@ -215,6 +215,7 @@ end
class PostgresqlUUIDTestNilDefault < ActiveRecord::TestCase
include PostgresqlUUIDHelper
+ include SchemaDumpingHelper
setup do
enable_extension!('uuid-ossp', connection)
@@ -238,6 +239,11 @@ class PostgresqlUUIDTestNilDefault < ActiveRecord::TestCase
WHERE a.attname='id' AND a.attrelid = 'pg_uuids'::regclass").first
assert_nil col_desc["default"]
end
+
+ def test_schema_dumper_for_uuid_primary_key_with_default_override_via_nil
+ schema = dump_table_schema "pg_uuids"
+ assert_match(/\bcreate_table "pg_uuids", id: :uuid, default: nil/, schema)
+ end
end
end