Compare commits
1 Commits
develop
...
initial-db
Author | SHA1 | Date |
---|---|---|
Jef Roosens | 8de1efcd7f |
|
@ -178,9 +178,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "diesel"
|
||||
version = "1.4.8"
|
||||
version = "1.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b28135ecf6b7d446b43e27e225622a038cc4e2930a1022f51cdb97ada19b8e4d"
|
||||
checksum = "bba51ca66f57261fd17cadf8b73e4775cc307d0521d855de3f5de91a8f074e0e"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"byteorder",
|
||||
|
|
|
@ -8,7 +8,7 @@ edition = "2018"
|
|||
|
||||
[dependencies]
|
||||
rocket = "0.5.0-rc.1"
|
||||
diesel = { version = "1.4.8", features = ["postgres"] }
|
||||
diesel = { version = "1.4.7", features = ["postgres"] }
|
||||
diesel_migrations = "1.4.0"
|
||||
|
||||
[dependencies.rocket_sync_db_pools]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM rust:1.57-alpine3.13 AS builder
|
||||
FROM rust:1.53-alpine3.13 AS builder
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
|
@ -15,7 +15,7 @@ RUN cargo build \
|
|||
--release
|
||||
|
||||
|
||||
FROM alpine:3.15
|
||||
FROM alpine:3.13
|
||||
|
||||
COPY --from=builder /src/target/release/hilde /usr/local/bin/hilde
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE packages;
|
||||
DROP TABLE maintainers;
|
||||
DROP TYPE package_type;
|
|
@ -0,0 +1,34 @@
|
|||
CREATE TABLE maintainers (
|
||||
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
|
||||
|
||||
name text NOT NULL,
|
||||
email text NOT NULL,
|
||||
|
||||
UNIQUE (name, email)
|
||||
);
|
||||
|
||||
CREATE TYPE package_type AS ENUM ('deb', 'dsc', 'udeb');
|
||||
|
||||
-- Table containing information about a package
|
||||
CREATE TABLE packages (
|
||||
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
|
||||
|
||||
name text NOT NULL,
|
||||
type package_type NOT NULL,
|
||||
version text NOT NULL,
|
||||
-- This is just text, as there's no guarantee the source is present on this
|
||||
-- repository.
|
||||
source text,
|
||||
section text,
|
||||
priority text,
|
||||
-- NOTE: could this be better than just text?
|
||||
architecture text NOT NULL,
|
||||
essential boolean DEFAULT false,
|
||||
installed_size integer,
|
||||
maintainer_id uuid REFERENCES maintainers (id) NOT NULL,
|
||||
description text NOT NULL,
|
||||
homepage text,
|
||||
|
||||
-- NOTE: I don't think this is enough because architecture can be a wildcard
|
||||
UNIQUE (name, version, architecture)
|
||||
);
|
|
@ -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,
|
||||
);
|
Reference in New Issue