feat(gpodder_sqlite): add user admin field
parent
346c27fc3f
commit
669aa475ca
|
@ -5,6 +5,7 @@ pub struct User {
|
||||||
pub id: i64,
|
pub id: i64,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password_hash: String,
|
pub password_hash: String,
|
||||||
|
pub admin: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[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 id: i64,
|
||||||
pub username: String,
|
pub username: String,
|
||||||
pub password_hash: String,
|
pub password_hash: String,
|
||||||
|
pub admin: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Insertable)]
|
#[derive(Insertable)]
|
||||||
|
|
|
@ -18,6 +18,7 @@ impl From<User> for gpodder::User {
|
||||||
id: value.id,
|
id: value.id,
|
||||||
username: value.username,
|
username: value.username,
|
||||||
password_hash: value.password_hash,
|
password_hash: value.password_hash,
|
||||||
|
admin: value.admin,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ diesel::table! {
|
||||||
id -> BigInt,
|
id -> BigInt,
|
||||||
username -> Text,
|
username -> Text,
|
||||||
password_hash -> Text,
|
password_hash -> Text,
|
||||||
|
admin -> Bool,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue