defmodule DaProductApp.Repo.Migrations.CreateParameterCategories do use Ecto.Migration def change do create table(:parameter_categories) do add :name, :string, null: false add :code, :string add :description, :string add :sort_order, :integer, default: 0 add :is_active, :boolean, default: true add :parent_id, :id timestamps(type: :utc_datetime) end create unique_index(:parameter_categories, [:name]) create unique_index(:parameter_categories, [:code]) create index(:parameter_categories, [:parent_id]) create index(:parameter_categories, [:is_active]) create index(:parameter_categories, [:sort_order]) end end