Update
This commit is contained in:
parent
58049c93d4
commit
894866ca03
22 changed files with 344 additions and 213 deletions
23
priv/repo/migrations/20250617091354_create_relations.exs
Normal file
23
priv/repo/migrations/20250617091354_create_relations.exs
Normal file
|
@ -0,0 +1,23 @@
|
|||
defmodule Nulla.Repo.Migrations.CreateActorRelations do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:relations, primary_key: false) do
|
||||
add :id, :bigint, primary_key: true
|
||||
add :source_id, :bigint, null: false
|
||||
add :target_id, :bigint, null: false
|
||||
add :type, :string, null: false
|
||||
add :status, :string, null: false
|
||||
add :activity_id, :bigint
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:relations, [:source_id])
|
||||
create index(:relations, [:target_id])
|
||||
create index(:relations, [:type])
|
||||
create index(:relations, [:activity_id])
|
||||
|
||||
create unique_index(:relations, [:source_id, :target_id, :type])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue