Added first draft database schema
All checks were successful
continuous-integration/drone the build was successful

This commit is contained in:
Jef Roosens 2021-06-27 16:54:13 +02:00
parent 02fe8d2de7
commit 8de1efcd7f
Signed by: Jef Roosens
GPG key ID: 955C0660072F691F
3 changed files with 71 additions and 0 deletions

33
src/schema.rs Normal file
View file

@ -0,0 +1,33 @@
table! {
maintainers (id) {
id -> Uuid,
name -> Text,
email -> Text,
}
}
table! {
packages (id) {
id -> Uuid,
name -> Text,
#[sql_name = "type"]
type_ -> Package_type,
version -> Text,
source -> Nullable<Text>,
section -> Nullable<Text>,
priority -> Nullable<Text>,
architecture -> Text,
essential -> Nullable<Bool>,
installed_size -> Nullable<Int4>,
maintainer_id -> Uuid,
description -> Text,
homepage -> Nullable<Text>,
}
}
joinable!(packages -> maintainers (maintainer_id));
allow_tables_to_appear_in_same_query!(
maintainers,
packages,
);