Skip to content

Commit

Permalink
feat: nodes with prev_id & parent_id
Browse files Browse the repository at this point in the history
  • Loading branch information
sorax committed Dec 7, 2023
1 parent 573ab3c commit 8afde37
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/radiator/outline/node.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defmodule Radiator.Outline.Node do
schema "outline_nodes" do
field :content, :string
field :creator_id, :integer
field :parent_id, Ecto.UUID
field :prev_id, Ecto.UUID

timestamps(type: :utc_datetime)
end
Expand All @@ -15,7 +17,9 @@ defmodule Radiator.Outline.Node do
]

@optional_fields [
:creator_id
:creator_id,
:parent_id,
:prev_id
]

@all_fields @optional_fields ++ @required_fields
Expand Down
10 changes: 10 additions & 0 deletions priv/repo/migrations/20231203213908_add_structure_for_nodes.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
defmodule Radiator.Repo.Migrations.AddStructureForNodes do
use Ecto.Migration

def change do
alter table(:outline_nodes) do
add :parent_id, :uuid
add :prev_id, :uuid
end
end
end

0 comments on commit 8afde37

Please sign in to comment.