defmodule Nulla.Repo.Migrations.CreateActivities do use Ecto.Migration def change do create table(:activities, primary_key: false) do add :id, :bigint, primary_key: true add :ap_id, :string, null: false add :type, :string, null: false add :actor_id, references(:actors, type: :bigint, on_delete: :nothing), null: false add :object, :map, null: false add :to, {:array, :string}, default: [] timestamps() end create index(:activities, [:type]) create index(:activities, [:actor_id]) end end