Added migrations, each creating a new database table
This commit is contained in:
20
priv/repo/migrations/20250725144032_create_comments.exs
Normal file
20
priv/repo/migrations/20250725144032_create_comments.exs
Normal file
@@ -0,0 +1,20 @@
|
||||
defmodule Sukaato.Repo.Migrations.CreateComments do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:comments) do
|
||||
add :slug, :string
|
||||
add :tripcode, :string
|
||||
add :content, :text
|
||||
add :ledit, :utc_datetime
|
||||
add :post_id, references(:posts, on_delete: :nothing)
|
||||
add :reply_to, references(:comments, on_delete: :nothing)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create unique_index(:comments, [:tripcode])
|
||||
create index(:comments, [:post_id])
|
||||
create index(:comments, [:reply_to])
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user