Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Basic steps are
config :spur, repo: MyApp.Repo
```

3. Generate and run a migration that adds an "activities" table to your repo (see priv/test/migrations). To use a different table name, set the `activities_table_name` config.
3. Generate and run a migration that adds an "activities" table to your repo (see priv/test/migrations). To use a different table name, set the `activities_table_name` config. To use
`:uuid` primary key for your activities table, set the `uuid_primary_key_enabled` config to true.


That's enough to start tracking arbitrary activities:
Expand Down
5 changes: 5 additions & 0 deletions lib/spur/activity.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ defmodule Spur.Activity do

import Ecto.Changeset

if Application.get_env(:spur, :uuid_primary_key_enabled, false) do
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
end

schema Application.get_env(:spur, :activities_table_name, "activities") do
field(:action, :string)
field(:actor, :string)
Expand Down