feat(gpodder_sqlite): add user admin field

signup-links
Jef Roosens 2025-06-24 13:07:06 +02:00
parent 346c27fc3f
commit 669aa475ca
No known key found for this signature in database
GPG Key ID: 21FD3D77D56BAF49
6 changed files with 8 additions and 0 deletions

View File

@ -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)]

View File

@ -0,0 +1,2 @@
alter table users
drop column admin;

View File

@ -0,0 +1,2 @@
alter table users
add column admin boolean not null default false;

View File

@ -9,6 +9,7 @@ pub struct User {
pub id: i64,
pub username: String,
pub password_hash: String,
pub admin: bool,
}
#[derive(Insertable)]

View File

@ -18,6 +18,7 @@ impl From<User> for gpodder::User {
id: value.id,
username: value.username,
password_hash: value.password_hash,
admin: value.admin,
}
}
}

View File

@ -58,6 +58,7 @@ diesel::table! {
id -> BigInt,
username -> Text,
password_hash -> Text,
admin -> Bool,
}
}