Add models and migrations
This commit is contained in:
parent
182523d36d
commit
9e542bc790
33 changed files with 597 additions and 125 deletions
18
priv/repo/migrations/20250604083506_create_notes.exs
Normal file
18
priv/repo/migrations/20250604083506_create_notes.exs
Normal file
|
@ -0,0 +1,18 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateNotes do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:notes) do
|
||||
add :content, :string
|
||||
add :visibility, :string, default: "public"
|
||||
add :sensitive, :boolean, default: false
|
||||
add :language, :string
|
||||
add :in_reply_to, :string
|
||||
add :user_id, references(:users, on_delete: :delete_all)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create index(:notes, [:user_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue