SQL type `BIGINT UNSIGNED`) is not compatible with SQL type `BIGINT`
sea-orm-cli generate entity -u mysql://XXXX --with-serde both --max-connections 5 -v -o ./entity
Connecting to MySQL ...
2024-10-25T08:19:01.887683Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2024-10-25T08:19:01.938704Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET\n sql_mode =(\n SELECT\n CONCAT(\n @ @sql_mode,\n ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'\n )\n ),\n time_zone = '+00:00',\n NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=24.467833ms elapsed_secs=0.024467833
Discovering schema ...
2024-10-25T08:19:02.024917Z DEBUG sqlx::query: summary="SELECT version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=51.282375ms elapsed_secs=0.051282375
2024-10-25T08:19:02.079147Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2024-10-25T08:19:02.131346Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET\n sql_mode =(\n SELECT\n CONCAT(\n @ @sql_mode,\n ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'\n )\n ),\n time_zone = '+00:00',\n NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=25.175959ms elapsed_secs=0.025175959
2024-10-25T08:19:02.188393Z DEBUG sqlx::query: summary="SELECT table_name, engine, auto_increment, …" db.statement="\n\nSELECT\n table_name,\n engine,\n auto_increment,\n table_collation,\n table_comment,\n create_options,\n collation_character_set_applicability.character_set_name\nFROM\n information_schema.tables\n LEFT JOIN information_schema.collation_character_set_applicability ON collation_character_set_applicability.collation_name = tables.table_collation\nWHERE\n table_schema = ?\n AND table_type IN (?, ?)\nORDER BY\n table_name ASC\n" rows_affected=0 rows_returned=14 elapsed=56.516042ms elapsed_secs=0.056516042
thread 'main' panicked at /Users/lijing/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/sqlx-core-0.7.4/src/row.rs:72:37:
called Result::unwrap() on an Err value: ColumnDecode { index: "2", source: "mismatched types; Rust type core::option::Option<u64> (as SQL type BIGINT UNSIGNED) is not compatible with SQL type BIGINT" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Hi, could you check if this still happens on the latest version?
Hi, could you check if this still happens on the latest version?
sea-orm-cli --version
sea-orm-cli 1.1.14
Connecting to MySQL ...
2025-08-16T02:12:29.985675Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2025-08-16T02:12:30.045703Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=29.983458ms elapsed_secs=0.029983458
Discovering schema ...
2025-08-16T02:12:30.135384Z DEBUG sqlx::query: summary="SELECT version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=59.572833ms elapsed_secs=0.059572833
2025-08-16T02:12:30.195938Z DEBUG sqlx_mysql::connection::tls: not performing TLS upgrade: unsupported by server
2025-08-16T02:12:30.255947Z DEBUG sqlx::query: summary="SET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES …" db.statement="\n\nSET sql_mode=(SELECT CONCAT(@@sql_mode, ',PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION')),time_zone='+00:00',NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;\n" rows_affected=0 rows_returned=0 elapsed=30.372417ms elapsed_secs=0.030372417
2025-08-16T02:12:30.346455Z DEBUG sqlx::query: summary="SELECT `table_name`, `engine`, `auto_increment`, …" db.statement="\n\nSELECT `table_name`, `engine`, `auto_increment`, `table_collation`, `table_comment`, `create_options`, `collation_character_set_applicability`.`character_set_name` FROM `information_schema`.`tables` LEFT JOIN `information_schema`.`collation_character_set_applicability` ON `collation_character_set_applicability`.`collation_name` = `tables`.`table_collation` WHERE `table_schema` = ? AND `table_type` IN (?, ?) ORDER BY `table_name` ASC\n" rows_affected=0 rows_returned=18 elapsed=90.406958ms elapsed_secs=0.090406958
thread 'main' panicked at /Users/lijing/.cargo/registry/src/rsproxy.cn-e3de039b2554c837/sea-schema-0.16.2/src/mysql/query/table.rs:97:33:
called `Result::unwrap()` on an `Err` value: ColumnDecode { index: "2", source: "mismatched types; Rust type `core::option::Option<u64>` (as SQL type `BIGINT UNSIGNED`) is not compatible with SQL type `BIGINT`" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace