Navigation Menu

Skip to content

Commit

Permalink
Make default table type to be Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 26, 2014
1 parent 150f4f7 commit 4ecc831
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/droonga/catalog/schema.rb
Expand Up @@ -127,7 +127,7 @@ def ==(other)
end

def type
@data["type"]
@data["type"] || "Hash"
end

def key_type
Expand All @@ -152,7 +152,6 @@ def type_flag
"TABLE_PAT_KEY"
when "DoubleArrayTrie"
"TABLE_DAT_KEY"
# TODO default is Hash
else
# TODO raise appropriate error
end
Expand Down
6 changes: 6 additions & 0 deletions test/unit/catalog/test_schema.rb
Expand Up @@ -143,6 +143,12 @@ def test_name
{}).name)
end

def test_type_default
assert_equal("Hash",
create_table("table_name",
{}).type)
end

def test_type
assert_equal("Hash",
create_table("table_name",
Expand Down

0 comments on commit 4ecc831

Please sign in to comment.