Changed data import to add alongside rather than removing.

This commit is contained in:
jude
2023-03-24 19:41:34 +00:00
parent 4e0163f2cb
commit 314c72e132
6 changed files with 16 additions and 26 deletions

View File

@ -172,7 +172,7 @@ pub async fn import_reminders(
create_reminder(
ctx.inner(),
pool.inner(),
transaction,
GuildId(id),
UserId(user_id),
reminder,
@ -320,13 +320,6 @@ pub async fn import_todos(
}
}
let _ = sqlx::query!(
"DELETE FROM todos WHERE guild_id = (SELECT id FROM guilds WHERE guild = ?)",
id
)
.execute(pool.inner())
.await;
let query_str = format!(
"INSERT INTO todos (value, channel_id, guild_id) VALUES {}",
vec![query_placeholder].repeat(query_params.len()).join(",")