Let’s take the example from the README, and let’s say that I have a StatusEnum
module with the following values:
[:registered, :active, :inactive, :archived, "registered", "active", "inactive", "archived"]
And then, I have a migration to add the status type to the users table:
def change do
StatusEnum.create_type
create table(:users_pg) do
add :status, StatusEnum.type()
end
end
Now, let’s say that I want to update the StatusEnum
with a new value, for example :moderator
, but I’ve already ran the migration and I don’t want to roll it back.
I know that I can easily add the value :moderator
to the module where I defined StatusEnum
, but what about the migration, especially since it was already ran?