mirror of
https://github.com/plausible/analytics.git
synced 2024-12-02 07:38:47 +03:00
14 lines
408 B
Elixir
14 lines
408 B
Elixir
|
defmodule Plausible.Repo.Migrations.AddRoleToSiteMemberships do
|
||
|
use Ecto.Migration
|
||
|
|
||
|
def change do
|
||
|
create_query = "CREATE TYPE site_membership_role AS ENUM ('owner', 'admin', 'viewer')"
|
||
|
drop_query = "DROP TYPE site_membership_role"
|
||
|
execute(create_query, drop_query)
|
||
|
|
||
|
alter table(:site_memberships) do
|
||
|
add :role, :site_membership_role, null: false, default: "owner"
|
||
|
end
|
||
|
end
|
||
|
end
|