19 lines
517 B
Elixir
19 lines
517 B
Elixir
defmodule Nulla.Repo.Migrations.CreateNotes do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:notes, primary_key: false) do
|
|
add :id, :bigint, primary_key: true
|
|
add :content, :text
|
|
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
|