Update migrations
This commit is contained in:
parent
50abfe4748
commit
57efda7638
12 changed files with 56 additions and 35 deletions
19
priv/repo/migrations/20250615132202_create_notifications.exs
Normal file
19
priv/repo/migrations/20250615132202_create_notifications.exs
Normal file
|
@ -0,0 +1,19 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateNotifications do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:notifications, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :user_id, references(:users, on_delete: :delete_all), null: false
|
||||
add :actor_id, references(:actors, 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
|
Loading…
Add table
Add a link
Reference in a new issue