defmodule DaProductApp.Repo.Migrations.AddYspStatusEnumValues do use Ecto.Migration def up do # For MySQL, we don't need to alter the column structure since it's already varchar(20) # The enum validation happens in the Ecto schema, not at the database level # This migration serves as documentation that we've added YSP-specific status values execute(""" ALTER TABLE pos_temp_transaction MODIFY COLUMN status VARCHAR(20) NOT NULL COMMENT 'Processing status: CREATED, VALIDATED, SENT_TO_UPSTREAM, WAITING_RESPONSE, RESPONSE_RECEIVED, PROCESSING_RESPONSE, COMPLETED, ERROR, TIMEOUT, PENDING, APPROVED, DECLINED, REVERSED' """) # Note: pos_reversal table will be created in a separate migration when needed end def down do # Revert to original comment without YSP-specific values execute(""" ALTER TABLE pos_temp_transaction MODIFY COLUMN status VARCHAR(20) NOT NULL COMMENT 'Processing status: CREATED, VALIDATED, SENT_TO_UPSTREAM, WAITING_RESPONSE, RESPONSE_RECEIVED, PROCESSING_RESPONSE, COMPLETED, ERROR, TIMEOUT' """) end end