This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
bdfr-browser/priv/repo/migrations/20230813194606_create_comments.exs

17 lines
420 B
Elixir

defmodule BdfrBrowser.Repo.Migrations.CreateComments do
use Ecto.Migration
def change do
create table(:comments) do
add :author, :string
add :body, :text
add :score, :integer
add :posted_at, :utc_datetime
add :post_id, references(:posts)
add :parent_id, references(:comments)
end
create index("comments", :post_id)
create index("comments", :parent_id)
end
end