sea-orm icon indicating copy to clipboard operation
sea-orm copied to clipboard

v1.1.2: cannot find method or associated constant `enum_type_name` in trait `sea_orm::sea_query::ValueType

Open behnam-oneschema opened this issue 11 months ago • 3 comments
trafficstars

Description

I'm trying to upgrade from 1.1.1 to 1.1.2 and keep getting these errors, for every single field definition on the generated pub struct Model:

error[E0576]: cannot find method or associated constant `enum_type_name` in trait `sea_orm::sea_query::ValueType`
  --> .../src/db/entities/templates.rs:22:5
   |
22 |     #[sea_orm(column_type = "Text", nullable)]
   |     ^ not found in `sea_orm::sea_query::ValueType`

I'm assuming that it's not an issue with my code, specially considering that this is a patch version bump.

Steps to Reproduce

  1. Generate code using sea-orm-cli
  2. Get rustc errors when checking/building the code.
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "templates")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i64,
    #[sea_orm(column_type = "Text")]
    pub label: String,
    #[sea_orm(column_type = "Text", nullable)]
    pub description: Option<String>,
    // ...
}

Expected Behavior

No rustc errors, similar to 1.1.1.

Actual Behavior

(see above)

Reproduces How Often

Always. Tried cleaning up the build env, still the same.

Workarounds

Not aware of any.

Reproducible Example

My code-gen script is:

sea-orm-cli generate entity \
  -o $ENTITIES_ROOT \
  --with-copy-enums \
  --with-serde both \
  --ignore-tables=schema_info

Versions

│   ├── sea-orm v1.1.2
│   │   ├── sea-orm-macros v1.1.2 (proc-macro)
│   │   │   ├── sea-bae v0.2.1 (proc-macro)
│   │   ├── sea-query v0.32.0
│   │   ├── sea-query-binder v0.7.0
│   │   │   ├── sea-query v0.32.0 (*)
├── sea-orm v1.1.2 (*)

Command-line:

≥ sea-orm-cli --version
sea-orm-cli 1.1.2

Cargo.toml:

sea-orm = { version = "1.1.2", features = [
  "sqlx-postgres",
  "runtime-tokio-rustls",
  "macros",
  "postgres-array",
] }

behnam-oneschema avatar Dec 10 '24 19:12 behnam-oneschema