Closed exzachlyvv closed 2 years ago
Hi @exzachlyvv, are you using MySQL?
Yep, MySQL
Currently, we did not capture UNSIGNED
flag inside sea-schema
so sea-orm-codegen
fail to annotate the column as u64
.
I guess unsigned integer types are not included in sea-query
because not all database drivers support it? @tyt2y3
https://github.com/SeaQL/sea-query/blob/e05a85196fdba9b838b4fb5b62970c783d9c604d/src/table/column.rs#L12-L39
Yes, you are right. I checked, SeaSchema did parse unsigned types.
col_type: SmallInt(
NumericAttr {
maximum: None,
decimal: None,
unsigned: Some(
true,
),
zero_fill: None,
},
)
But yeah we have to add it to SeaQuery first before it could be supported. The implication is though, it will not be portable as Postgres does not support unsigned.
It appears that orm-cli failed to handle unsigned type as a primary key when generating models.
This later resulted in a: