remove: channel_mutes column
This commit is contained in:
parent
6d333378a4
commit
abd23e0ccc
5 changed files with 14 additions and 18 deletions
|
@ -72,8 +72,7 @@
|
||||||
(a
|
(a
|
||||||
("href" "{{ config.service_hosts.tawny }}/api/v1/auth/set_token?token=")
|
("href" "{{ config.service_hosts.tawny }}/api/v1/auth/set_token?token=")
|
||||||
(icon (text "message-circle"))
|
(icon (text "message-circle"))
|
||||||
(str (text "communities:label.chats"))
|
(str (text "communities:label.chats")))
|
||||||
(span ("class" "chip") (text "beta")))
|
|
||||||
(text "{%- endif %}")
|
(text "{%- endif %}")
|
||||||
(a
|
(a
|
||||||
("href" "/mail")
|
("href" "/mail")
|
||||||
|
|
|
@ -123,15 +123,14 @@ impl DataManager {
|
||||||
was_purchased: get!(x->25(i32)) as i8 == 1,
|
was_purchased: get!(x->25(i32)) as i8 == 1,
|
||||||
browser_session: get!(x->26(String)),
|
browser_session: get!(x->26(String)),
|
||||||
ban_reason: get!(x->27(String)),
|
ban_reason: get!(x->27(String)),
|
||||||
channel_mutes: serde_json::from_str(&get!(x->28(String)).to_string()).unwrap(),
|
is_deactivated: get!(x->28(i32)) as i8 == 1,
|
||||||
is_deactivated: get!(x->29(i32)) as i8 == 1,
|
ban_expire: get!(x->29(i64)) as usize,
|
||||||
ban_expire: get!(x->30(i64)) as usize,
|
coins: get!(x->30(i32)),
|
||||||
coins: get!(x->31(i32)),
|
checkouts: serde_json::from_str(&get!(x->31(String)).to_string()).unwrap(),
|
||||||
checkouts: serde_json::from_str(&get!(x->32(String)).to_string()).unwrap(),
|
applied_configurations: serde_json::from_str(&get!(x->32(String)).to_string()).unwrap(),
|
||||||
applied_configurations: serde_json::from_str(&get!(x->33(String)).to_string()).unwrap(),
|
last_policy_consent: get!(x->33(i64)) as usize,
|
||||||
last_policy_consent: get!(x->34(i64)) as usize,
|
close_friends_stack: get!(x->34(i64)) as usize,
|
||||||
close_friends_stack: get!(x->35(i64)) as usize,
|
missed_messages_count: get!(x->35(i32)) as usize,
|
||||||
missed_messages_count: get!(x->36(i32)) as usize,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +287,7 @@ impl DataManager {
|
||||||
|
|
||||||
let res = execute!(
|
let res = execute!(
|
||||||
&conn,
|
&conn,
|
||||||
"INSERT INTO users VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36)",
|
"INSERT INTO users VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35)",
|
||||||
params![
|
params![
|
||||||
&(data.id as i64),
|
&(data.id as i64),
|
||||||
&(data.created as i64),
|
&(data.created as i64),
|
||||||
|
@ -318,7 +317,6 @@ impl DataManager {
|
||||||
&if data.was_purchased { 1_i32 } else { 0_i32 },
|
&if data.was_purchased { 1_i32 } else { 0_i32 },
|
||||||
&data.browser_session,
|
&data.browser_session,
|
||||||
&data.ban_reason,
|
&data.ban_reason,
|
||||||
&serde_json::to_string(&data.channel_mutes).unwrap(),
|
|
||||||
&if data.is_deactivated { 1_i32 } else { 0_i32 },
|
&if data.is_deactivated { 1_i32 } else { 0_i32 },
|
||||||
&(data.ban_expire as i64),
|
&(data.ban_expire as i64),
|
||||||
&(data.coins as i32),
|
&(data.coins as i32),
|
||||||
|
|
|
@ -27,7 +27,6 @@ CREATE TABLE IF NOT EXISTS users (
|
||||||
was_purchased INT NOT NULL,
|
was_purchased INT NOT NULL,
|
||||||
browser_session TEXT NOT NULL,
|
browser_session TEXT NOT NULL,
|
||||||
ban_reason TEXT NOT NULL,
|
ban_reason TEXT NOT NULL,
|
||||||
channel_mutes TEXT NOT NULL,
|
|
||||||
is_deactivated INT NOT NULL,
|
is_deactivated INT NOT NULL,
|
||||||
ban_expire BIGINT NOT NULL,
|
ban_expire BIGINT NOT NULL,
|
||||||
coins INT NOT NULL,
|
coins INT NOT NULL,
|
||||||
|
|
|
@ -89,3 +89,7 @@ ADD COLUMN IF NOT EXISTS is_locked INT DEFAULT 0;
|
||||||
-- users missed_messages_count
|
-- users missed_messages_count
|
||||||
ALTER TABLE users
|
ALTER TABLE users
|
||||||
ADD COLUMN IF NOT EXISTS missed_messages_count INT DEFAULT 0;
|
ADD COLUMN IF NOT EXISTS missed_messages_count INT DEFAULT 0;
|
||||||
|
|
||||||
|
-- users channel_mutes
|
||||||
|
ALTER TABLE users
|
||||||
|
DROP COLUMN IF EXISTS channel_mutes;
|
||||||
|
|
|
@ -85,9 +85,6 @@ pub struct User {
|
||||||
/// The reason the user was banned.
|
/// The reason the user was banned.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub ban_reason: String,
|
pub ban_reason: String,
|
||||||
/// IDs of channels the user has muted.
|
|
||||||
#[serde(default)]
|
|
||||||
pub channel_mutes: Vec<usize>,
|
|
||||||
/// If the user is deactivated. Deactivated users act almost like deleted
|
/// If the user is deactivated. Deactivated users act almost like deleted
|
||||||
/// users, but their data is not wiped.
|
/// users, but their data is not wiped.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
@ -461,7 +458,6 @@ impl User {
|
||||||
was_purchased: false,
|
was_purchased: false,
|
||||||
browser_session: String::new(),
|
browser_session: String::new(),
|
||||||
ban_reason: String::new(),
|
ban_reason: String::new(),
|
||||||
channel_mutes: Vec::new(),
|
|
||||||
is_deactivated: false,
|
is_deactivated: false,
|
||||||
ban_expire: 0,
|
ban_expire: 0,
|
||||||
coins: 0,
|
coins: 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue