Add models and migrations

This commit is contained in:
Mirai Kumiko 2025-06-06 16:07:04 +02:00
parent 182523d36d
commit 9e542bc790
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
33 changed files with 597 additions and 125 deletions

View file

@ -0,0 +1,18 @@
defmodule Nulla.Repo.Migrations.CreateNotifications do
use Ecto.Migration
def change do
create table(:notifications) do
add :user_id, references(:users, on_delete: :delete_all), null: false
add :actor_id, references(:users, on_delete: :nilify_all)
add :type, :string, null: false
add :data, :map
add :read, :boolean, default: false, null: false
timestamps()
end
create index(:notifications, [:user_id])
create index(:notifications, [:actor_id])
end
end