From 17cde8477a909c370c370e054c329adef81266c1 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Mon, 28 Oct 2024 14:58:44 +0800 Subject: [PATCH] fix(meta): fix migration query under postgres meta store for #18753 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(), )