feat(gpodder_sqlite): add user admin field
parent
346c27fc3f
commit
669aa475ca
|
@ -5,6 +5,7 @@ pub struct User {
|
|||
pub id: i64,
|
||||
pub username: String,
|
||||
pub password_hash: String,
|
||||
pub admin: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
alter table users
|
||||
drop column admin;
|
|
@ -0,0 +1,2 @@
|
|||
alter table users
|
||||
add column admin boolean not null default false;
|
|
@ -9,6 +9,7 @@ pub struct User {
|
|||
pub id: i64,
|
||||
pub username: String,
|
||||
pub password_hash: String,
|
||||
pub admin: bool,
|
||||
}
|
||||
|
||||
#[derive(Insertable)]
|
||||
|
|
|
@ -18,6 +18,7 @@ impl From<User> for gpodder::User {
|
|||
id: value.id,
|
||||
username: value.username,
|
||||
password_hash: value.password_hash,
|
||||
admin: value.admin,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ diesel::table! {
|
|||
id -> BigInt,
|
||||
username -> Text,
|
||||
password_hash -> Text,
|
||||
admin -> Bool,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue