From 2e77c88e1a2e5d20ed6203ed80408a67108723e9 Mon Sep 17 00:00:00 2001 From: Juha Suuraho Date: Sun, 20 Mar 2016 15:47:32 +0200 Subject: [PATCH] Support Postgresql 9.4 jsonb column type --- lib/flex_columns/definition/flex_column_contents_class.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/flex_columns/definition/flex_column_contents_class.rb b/lib/flex_columns/definition/flex_column_contents_class.rb index 1744eb4..4e5cfb3 100644 --- a/lib/flex_columns/definition/flex_column_contents_class.rb +++ b/lib/flex_columns/definition/flex_column_contents_class.rb @@ -26,6 +26,7 @@ def _flex_columns_create_column_data(storage_string, data_source) storage = case column.type when :binary, :text, :json then column.type + when :jsonb then :json when :string then :text else raise "Unknown storage type: #{column.type.inspect}" end @@ -298,6 +299,8 @@ def is_acceptable_column_type?(column) true elsif column.sql_type == "json" # for PostgreSQL >= 9.2, which has a native JSON data type true + elsif column.sql_type == "jsonb" # for PostgreSQL >= 9.4, which has a native JSONB data type + true else false end