defmodule ProviderService.Repo.Migrations.CreateProviders do use Ecto.Migration def change do create table(:providers, primary_key: false) do add(:provider_id, :string, primary_key: true) add(:name, :string, null: false) add(:email, :string) add(:phone, :string) add(:contact_name, :string) add(:ruc, :string) add(:address, :string) add(:active, :boolean, default: true, null: false) add(:templates, :map, default: %{}) add(:default_templates, :map, default: %{}) timestamps(type: :utc_datetime_usec) end create(index(:providers, [:active])) create(index(:providers, [:name])) end end