Skip to content

Instantly share code, notes, and snippets.

@rlb3
Created May 25, 2022 03:52
Show Gist options
  • Save rlb3/6cc5589ea98fd71076e1d90527aca55f to your computer and use it in GitHub Desktop.
Save rlb3/6cc5589ea98fd71076e1d90527aca55f to your computer and use it in GitHub Desktop.
defp create_table() do
case :mnesia.create_table(@module, [
{:ram_copies, [node()]},
storage_properties: [[ets: [:compressed]]],
attributes: @attributes,
index: @indexes
]) do
:ok -> :ok
{:atomic, :ok} -> :ok
{:aborted, {:already_exists, @module}} -> :ok
any -> {:error, {:create_table, any}}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment