table name

This commit is contained in:
Filipriec
2026-08-25 13:01:32 +02:00
parent ed01d1ec5b
commit aea54f8d33
12 changed files with 135 additions and 45 deletions

View File

@@ -224,7 +224,10 @@ impl TableDraft {
) {
self.relation_table_options = options
.into_iter()
.filter(|option| option.name != self.table_name)
.filter(|option| {
common::alias::canonical_table_name(&option.name)
!= common::alias::canonical_table_name(&self.table_name)
})
.collect();
self.relation_tables = self
.relation_table_options
@@ -399,7 +402,10 @@ impl TableDraft {
&& self
.existing_profile_tables
.iter()
.any(|name| name == &self.table_name)
.any(|name| {
common::alias::canonical_table_name(name)
== common::alias::canonical_table_name(&self.table_name)
})
}
/// Position of `column` among the display columns, counting from 1.

View File

@@ -71,7 +71,7 @@ pub(crate) async fn load_page(
// for, so it is told what that table is on every render rather than left to
// read a copy that a `refresh` could have moved on from.
draft.columns.global = draft.global;
draft.columns.table_name = draft.table_name.trim().to_ascii_lowercase();
draft.columns.table_name = draft.table_name.trim().to_string();
let tree = definitions
.get_profile_tree(

View File

@@ -140,7 +140,7 @@ impl BuilderForm {
// takes no column that posts to one profile's books, and no link
// may point at the table being created.
global: self.global,
table_name: self.table_name.trim().to_ascii_lowercase(),
table_name: self.table_name.trim().to_string(),
};
// Drop display columns whose column is gone, so a stale post cannot