Skip to content

ALTER TABLE MODIFY enum not respected #1503

Closed
@ken2057

Description

@ken2057

Version

1.12.0

What happened?

When I modify a enum field with ALTER command, the generated models not added a new enum value, and it change the data type of field in struct as string instead of the "type ...Status string".

Relevant log output

No response

Database schema

CREATE TABLE authors (
  id   bigint primary key,
  status enum("ok", "init") default "init" not null
);

-- remove this alter to see the change in models.go
ALTER TABLE authors MODIFY status enum('init', 'done', 'canceled', 'processing', 'waiting') default "init" not null;

SQL queries

-- name: ListAuthors :many
select * from authors;

Configuration

No response

Playground URL

https://play.sqlc.dev/p/67134f04f43f5f6161fb11737e860c99c5db8a82b63d9f0a22e0f5707c500d57

What operating system are you using?

Linux

What database engines are you using?

MySQL

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions