Skip to content

Commit

Permalink
Hierarchical relationships example swaps columns (#3325)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidadragonfly committed Jun 7, 2020
1 parent abd6980 commit b8c5c73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ecto/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ defmodule Ecto.Schema do
schema "comments" do
field :content, :string
field :parent_id, :integer
belongs_to :parent, Comment, foreign_key: :id, references: :parent_id, define_field: false
belongs_to :parent, Comment, foreign_key: :parent_id, references: :id, define_field: false
has_many :children, Comment, foreign_key: :parent_id, references: :id
end
end
Expand Down

0 comments on commit b8c5c73

Please sign in to comment.