sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Type clash between enums from different tables

Open olivierboucher opened this issue 1 month ago • 0 comments

Version

1.30.0

What happened?

Given the following tables:

create table everflow_admin.customer_contract (
...
`status` enum('active', 'done', 'early_terminated', 'deleted', 'pending') not null,
...
)
create table everflow_admin.customer (
...
`contract_type` enum('customer', 'trial', 'pilot') not null default 'customer',
...
)

Generation will fail with message:

 type "customer_contract_type" already exists

Is there a way to override the naming for this enum some way or an other?

Relevant log output

type "customer_contract_type" already exists

Database schema


SQL queries


Configuration


Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

MySQL

What type of code are you generating?

Go

olivierboucher avatar Oct 30 '25 20:10 olivierboucher