Skip to content

Commit

Permalink
fix: fix the query in get_table_by_name (#17518) (#17520)
Browse files Browse the repository at this point in the history
Co-authored-by: August <[email protected]>
  • Loading branch information
github-actions[bot] and yezizp2012 authored Jul 1, 2024
1 parent dcce115 commit 18bc831
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/meta/model_v2/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ pub enum Relation {
on_delete = "Cascade"
)]
SelfRef1,
#[sea_orm(
belongs_to = "super::database::Entity",
from = "Column::DatabaseId",
to = "super::database::Column::DatabaseId",
on_update = "NoAction",
on_delete = "NoAction"
)]
Database2,
#[sea_orm(has_many = "super::schema::Entity")]
Schema,
#[sea_orm(has_many = "super::sink::Entity")]
Expand Down
2 changes: 1 addition & 1 deletion src/meta/src/controller/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ impl CatalogController {
let inner = self.inner.read().await;
let table_obj = Table::find()
.find_also_related(Object)
.join(JoinType::InnerJoin, object::Relation::Database.def())
.join(JoinType::InnerJoin, object::Relation::Database2.def())
.filter(
table::Column::Name
.eq(table_name)
Expand Down

0 comments on commit 18bc831

Please sign in to comment.