2023-11-06 15:07:18 -08:00
|
|
|
defmodule Pleroma.Repo.Migrations.CreateDomains do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
|
|
|
def change do
|
|
|
|
create_if_not_exists table(:domains) do
|
2023-11-09 15:53:17 -08:00
|
|
|
add(:domain, :citext)
|
2023-11-06 15:07:18 -08:00
|
|
|
add(:public, :boolean)
|
|
|
|
|
|
|
|
timestamps()
|
|
|
|
end
|
|
|
|
|
|
|
|
create_if_not_exists(unique_index(:domains, [:domain]))
|
|
|
|
|
|
|
|
alter table(:users) do
|
|
|
|
add(:domain_id, references(:domains))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|