From 78f28a70e56b789f618c72500010060bb1ce2cf2 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Fri, 1 Nov 2024 17:28:35 +0800 Subject: [PATCH] refine docs Signed-off-by: Bugen Zhao --- src/meta/model/migration/src/utils.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/meta/model/migration/src/utils.rs b/src/meta/model/migration/src/utils.rs index 8092001cd65aa..4f704374befd0 100644 --- a/src/meta/model/migration/src/utils.rs +++ b/src/meta/model/migration/src/utils.rs @@ -4,6 +4,10 @@ use sea_orm_migration::prelude::*; #[easy_ext::ext(ColumnDefExt)] impl ColumnDef { /// Set column type as `longblob` for MySQL, `bytea` for Postgres, and `blob` for Sqlite. + /// + /// Should be preferred over [`binary`](ColumnDef::binary) or [`blob`](ColumnDef::blob) for large binary fields, + /// typically the fields wrapping protobuf or other serialized data. Otherwise, MySQL will return an error + /// when the length exceeds 65535 bytes. pub fn rw_binary(&mut self, manager: &SchemaManager) -> &mut Self { match manager.get_database_backend() { DatabaseBackend::MySql => self.custom(extension::mysql::MySqlType::LongBlob),