Files
customer-service/priv/repo/migrations/20260224165602_add_customer_table.exs
HaimKortovich 4519f797fd
All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
partition by org_id and add auth
2026-05-15 10:08:54 -05:00

30 lines
863 B
Elixir

defmodule CustomerService.Repo.Migrations.AddCustomerTable do
use Ecto.Migration
def change do
create table(:customers, primary_key: false) do
add :id, :string, primary_key: true
add :org_id, :string, null: false
add :customer_id, :string, null: false
add :first_name, :string
add :last_name, :string
add :birth_date, :date
add :gender, :string
add :email, :string
add :phone, :string
add :document_id, :string
add :customer_type, :string, null: false, default: "individual"
add :legal_name, :string
add :commercial_name, :string
add :ruc, :string
add :legal_rep_name, :string
add :legal_rep_document_id, :string
add :address, :string
timestamps()
end
create index(:customers, [:org_id])
create index(:customers, [:email])
end
end