add: emojis is_animated

This commit is contained in:
trisua 2025-05-05 23:27:05 -04:00
parent 8e88cbbc6f
commit 570a290954
4 changed files with 19 additions and 5 deletions

View file

@ -4,5 +4,6 @@ CREATE TABLE IF NOT EXISTS emojis (
owner BIGINT NOT NULL,
community BIGINT NOT NULL,
upload_id BIGINT NOT NULL,
name TEXT NOT NULL
name TEXT NOT NULL,
is_animated INT NOT NULL
)

View file

@ -25,6 +25,7 @@ impl DataManager {
community: get!(x->3(i64)) as usize,
upload_id: get!(x->4(i64)) as usize,
name: get!(x->5(String)),
is_animated: get!(x->6(i32)) as i8 == 1,
}
}
@ -125,14 +126,15 @@ impl DataManager {
let res = execute!(
&conn,
"INSERT INTO emojis VALUES ($1, $2, $3, $4, $5, $6)",
"INSERT INTO emojis VALUES ($1, $2, $3, $4, $5, $6, $7)",
params![
&(data.id as i64),
&(data.owner as i64),
&(data.created as i64),
&(data.community as i64),
&(data.upload_id as i64),
&data.name
&data.name,
&{ if data.is_animated { 1 } else { 0 } },
]
);