From 1bb0eba617d9b976e9c02b5473cc01dc58848c7c Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Mon, 28 Oct 2024 16:02:09 +0800 Subject: [PATCH] fix(meta): fix migration query under postgres meta store for #18753 (#19151) Signed-off-by: Bugen Zhao --- .../src/m20241025_062548_singleton_vnode_count.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/meta/model/migration/src/m20241025_062548_singleton_vnode_count.rs b/src/meta/model/migration/src/m20241025_062548_singleton_vnode_count.rs index eb276099e24bf..bd2b12bd0724c 100644 --- a/src/meta/model/migration/src/m20241025_062548_singleton_vnode_count.rs +++ b/src/meta/model/migration/src/m20241025_062548_singleton_vnode_count.rs @@ -12,8 +12,16 @@ impl MigrationTrait for Migration { UpdateStatement::new() .table(Table::Table) .values([(Table::VnodeCount, Expr::value(1))]) - .and_where(Expr::col(Table::DistributionKey).eq(Expr::value("[]"))) - .and_where(Expr::col(Table::DistKeyInPk).eq(Expr::value("[]"))) + .and_where( + Expr::col(Table::DistributionKey) + .cast_as(Alias::new("varchar")) + .eq(Expr::value("[]")), + ) + .and_where( + Expr::col(Table::DistKeyInPk) + .cast_as(Alias::new("varchar")) + .eq(Expr::value("[]")), + ) .and_where(Expr::col(Table::VnodeColIndex).is_null()) .to_owned(), )