new channel schema which is meant to encompass both text and voice channels
This commit is contained in:
parent
558a40523e
commit
7c2e1abbc3
@ -3,5 +3,7 @@ CREATE TABLE IF NOT EXISTS `channels` (
|
||||
`id` INTEGER NOT NULL auto_increment,
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`permissions` INTEGER NOT NULL,
|
||||
`limit` INTEGER NOT NULL,
|
||||
`type` INTEGER NOT NULL,
|
||||
PRIMARY KEY(`id`)
|
||||
);
|
@ -16,10 +16,16 @@ pub struct User {
|
||||
pub date: u64,
|
||||
}
|
||||
|
||||
// These are to be use specifically for discerning between channel types
|
||||
pub const VOICE_CHANNEL: i32 = 1;
|
||||
pub const TEXT_CHANNEL: i32 = 2;
|
||||
|
||||
#[derive(Serialize, Deserialize, Queryable, Insertable)]
|
||||
#[table_name = "channels" ]
|
||||
pub struct Channel {
|
||||
pub id: i32,
|
||||
pub name: String,
|
||||
pub permissions: i32,
|
||||
pub limit: i32, // <= 0 means there is no limit
|
||||
pub type_: i32, // 1 for voice 2 for text
|
||||
}
|
@ -3,6 +3,9 @@ table! {
|
||||
id -> Integer,
|
||||
name -> Varchar,
|
||||
permissions -> Integer,
|
||||
limit -> Integer,
|
||||
#[sql_name = "type"]
|
||||
type_ -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user