Skip to content

Renaming enum values via migration doesn't update the generated code #428

Closed
@alibitek

Description

@alibitek

migration 0:

DROP TYPE IF EXISTS e_my_enum_type CASCADE;
CREATE TYPE e_my_enum_type AS ENUM (
    'green',
    'red',
    'black'
    );

generated code for migration 0:

type EMyEnumType string

const (
	EMyEnumTypeGreen EMyEnumType = "green"
	EMyEnumTypeRed   EMyEnumType = "red"
	EMyEnumTypeBlack EMyEnumType = "black"
)

Problem

migration 5:
ALTER TYPE e_my_enum_type RENAME VALUE 'black' TO 'yellow';

generated code after migration 5 is applied is the same as migration 0 for type EMyEnumType

Expected that it would be:

type EMyEnumType string

const (
	EMyEnumTypeGreen EMyEnumType = "green"
	EMyEnumTypeRed   EMyEnumType = "red"
	EMyEnumTypeBlack EMyEnumType = "yellow"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions