-
-
Notifications
You must be signed in to change notification settings - Fork 649
Open
Copy link
Labels
A-code-genArea: code generationArea: code generationgood first issueGood for newcomersGood for newcomers
Description
Description
If I have a field named model that's an enum, sea-orm-cli will generate an enum in sea_orm_active_enums named Model which conflicts with the automatically generated struct Model.
Same issue occurs for a field named relation, active_model, entity, or column.
Steps to Reproduce
- Create a table like this:
create table model_example (
id int unsigned primary key,
model enum("A", "B", "C")
)- Run sea-orm-cli to generate the code for this table
Expected Behavior
The CLI wouldn't generate code that fails to compile.
Actual Behavior
Both an enum Model and the struct Model are generated, causing a conflict in that file.
Reproduces How Often
Always reproducible.
Workarounds
You can of course just rename the enum manually.
Reproducible Example
Not sure best way to do this since the issue is with the autogenerated code and database setup, no user code.
Versions
├── sea-orm v0.12.1
│ ├── sea-orm-macros v0.12.1 (proc-macro)
│ │ ├── sea-bae v0.2.0 (proc-macro)
│ ├── sea-query v0.30.0
│ ├── sea-query-binder v0.5.0
│ │ ├── sea-query v0.30.0 (*)
Metadata
Metadata
Assignees
Labels
A-code-genArea: code generationArea: code generationgood first issueGood for newcomersGood for newcomers