sea-orm
sea-orm copied to clipboard
VarBinary(16) column breaks DeriveEntityModel derive
Description
After successfully importing the entity for a table containing a VarBinary(16) field, I am unable to build due to an error originating from the DeriveEntityModel derive in the entities Model struct.
Steps to Reproduce
- Import a table with a VarBinary(16) column
- Attempt to build with 'cargo build'
Expected Behavior
Program builds.
Actual Behavior
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "EventLog")]
pub struct Model {
#[sea_orm(primary_key, unique)]
pub event_log_id: i32,
pub event_type_id: i32,
pub user: String,
pub timestamp: DateTime,
#[sea_orm(column_type = "VarBinary(16)")]
pub ip_address: Vec<u8>,
pub event: Json,
}
error[E0308]: mismatched types --> src\entities\event_log.rs:5:35 | 5 | #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)] | ^^^^^^^^^^^^^^^^^ | | | expected
StringLen, found integer | arguments to this enum variant are incorrect
Reproduces How Often
Every time.
Workarounds
None.
Versions
MySQL 8.0.35 compiled for Linux (x86_64) Windows 11 Version 10.0.22631 Build 22631
sea-orm v1.0.0 sea-orm-macros v1.0.0 (proc-macro) sea-bae v0.2.0 (proc-macro) sea-query v0.31.0 sea-query-binder v0.6.0 sea-query v0.31.0 (*)