Skip to content

Commit 2070b45

Browse files
committed
path_column can be null
1 parent 9310ec5 commit 2070b45

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule MyApp.Repo.Migrations.CreateCatelogs do
4747
create table(:catelogs, primary_key: false) do
4848
add :id, :uuid, primary_key: true # the primary key is UUID
4949
add :name, :string
50-
add :path, :ltree, null: false, default: "" # Default value should to be `""`
50+
add :path, :ltree
5151

5252
timestamps()
5353
end

priv/repo/migrations/20180625095801_create_catelogs.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule Dummy.Repo.Migrations.CreateCatelogs do
77
create table(:catelogs, primary_key: false) do
88
add :id, :uuid, primary_key: true
99
add :name, :string
10-
add :path, :ltree, null: false, default: ""
10+
add :path, :ltree
1111

1212
timestamps()
1313
end

priv/repo/migrations/20180628144013_create_organizations.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Dummy.Repo.Migrations.CreateOrganizations do
66

77
create table(:organizations) do
88
add :name, :string
9-
add :ancestry, :ltree, null: false, default: ""
9+
add :ancestry, :ltree
1010
end
1111

1212
create index(:organizations, [:ancestry], using: "GIST")

test/ltree_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule Hierarch.LtreeTest do
2727
end
2828

2929
test "returns blank string" do
30-
assert Hierarch.LTree.parent_path("Top") == ""
30+
assert Hierarch.LTree.parent_path("Top") == nil
3131
end
3232
end
3333

0 commit comments

Comments
 (0)