summaryrefslogtreecommitdiff
path: root/src/channel/app.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-18 23:25:21 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-18 23:27:21 -0400
commitd3fbecc57b5d6fa3223b945a45fe21eb78ffd49b (patch)
treec62a5cb6636d5ef942c65e369e07b77fda42784c /src/channel/app.rs
parent777e4281431a036eb663b5eec70f347b7425737d (diff)
Switch to blanking tombstoned data with null, not empty string.
This accomplishes two things: * It removes the need for an additional `channel_name_reservation` table, since `channel.name` now only contains non-null values for active channels, and * It nicely dovetails with the idea that `null` means an unknown value in SQL-land.
Diffstat (limited to 'src/channel/app.rs')
-rw-r--r--src/channel/app.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channel/app.rs b/src/channel/app.rs
index 0409076..75c662d 100644
--- a/src/channel/app.rs
+++ b/src/channel/app.rs
@@ -23,9 +23,9 @@ impl<'a> Channels<'a> {
pub async fn create(&self, name: &str, created_at: &DateTime) -> Result<Channel, CreateError> {
let mut tx = self.db.begin().await?;
let created = tx.sequence().next(created_at).await?;
- let channel = tx.channels().create(name, &created).await?;
- tx.channels()
- .reserve_name(&channel, name)
+ let channel = tx
+ .channels()
+ .create(name, &created)
.await
.duplicate(|| CreateError::DuplicateName(name.into()))?;
tx.commit().await?;