mobilizon/priv/repo/migrations/20210526203337_add_user_activity_settings.exs

16 lines
451 B
Elixir
Raw Permalink Normal View History

defmodule Mobilizon.Storage.Repo.Migrations.AddUserActivitySettings do
use Ecto.Migration
def change do
create table(:user_activity_settings) do
add(:key, :string, nulla: false)
add(:method, :string, null: false)
add(:enabled, :boolean, null: false)
add(:user_id, references(:users, on_delete: :delete_all), null: false)
end
create(unique_index(:user_activity_settings, [:user_id, :key, :method]))
end
end