Restructure guilds table

This commit is contained in:
jude
2025-05-23 22:04:21 +01:00
parent 19cfacffe5
commit 02c5b05500
11 changed files with 59 additions and 64 deletions

View File

@ -31,7 +31,7 @@ pub async fn get_reminder_templates(
match sqlx::query_as_unchecked!(
ReminderTemplate,
"SELECT * FROM reminder_template WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?)",
"SELECT * FROM reminder_template WHERE guild_id = ?",
id
)
.fetch_all(pool.inner())
@ -87,7 +87,7 @@ pub async fn delete_reminder_template(
check_authorization(cookies, ctx.inner(), id).await?;
match sqlx::query!(
"DELETE FROM reminder_template WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?) AND id = ?",
"DELETE FROM reminder_template WHERE guild_id = ? AND id = ?",
id, delete_reminder_template.id
)
.fetch_all(pool.inner())