This commit is contained in:
Mirai Kumiko 2025-07-06 14:46:08 +02:00
parent f90a7133bc
commit 00ecbadeca
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
29 changed files with 871 additions and 12 deletions

View file

@ -0,0 +1,17 @@
defmodule Nulla.Repo.Migrations.CreateAnnounces do
use Ecto.Migration
def change do
create table(:announces, primary_key: false) do
add :id, :bigint, primary_key: true
add :actor_id, references(:actors, on_delete: :delete_all), null: false
add :note_id, references(:notes, on_delete: :delete_all), null: false
timestamps(type: :utc_datetime)
end
create index(:announces, [:actor_id])
create index(:announces, [:note_id])
create unique_index(:announces, [:actor_id, :note_id])
end
end