summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-02-05 15:28:42 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-02-05 15:30:21 +0100
commit2a1e017c063c462da3702e0227cb075643013988 (patch)
treee28c9b7d3dc96a3d83d3da9384effdd92b506e6a /src/db
parent2852e1b6e9a3987d923e6fe774172a00a12b9192 (diff)
Remove "tree" from submit
This removes the "tree" column from the "submits" table. This is because we do not store the build-tree in the database anymore. We don't actually need this feature and we can always re-build the tree from an old commit in the repository. Thus, this is not required anymore. Also, it is less easy to do as soon as the internal implementation changes from a "tree" structure to a "DAG" structure. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/db')
-rw-r--r--src/db/models/submit.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/src/db/models/submit.rs b/src/db/models/submit.rs
index a33bf96..7792adf 100644
--- a/src/db/models/submit.rs
+++ b/src/db/models/submit.rs
@@ -8,7 +8,6 @@
// SPDX-License-Identifier: EPL-2.0
//
-use anyhow::anyhow;
use anyhow::Context;
use anyhow::Error;
use anyhow::Result;
@@ -33,7 +32,6 @@ pub struct Submit {
pub requested_image_id: i32,
pub requested_package_id: i32,
pub repo_hash_id: i32,
- pub tree: serde_json::Value,
}
#[derive(Insertable)]
@@ -44,30 +42,23 @@ struct NewSubmit<'a> {
pub requested_image_id: i32,
pub requested_package_id: i32,
pub repo_hash_id: i32,
- pub tree: serde_json::Value,
}
impl Submit {
pub fn create(
database_connection: &PgConnection,
- t: &crate::package::Tree,
submit_datetime: &NaiveDateTime,
submit_id: &::uuid::Uuid,
requested_image: &Image,
requested_package: &Package,
repo_hash: &GitHash,
) -> Result<Submit> {
- let tree_json = serde_json::to_value(t)
- .context("Converting tree to JSON string")
- .with_context(|| anyhow!("Tree = {:#?}", t))?;
-
let new_submit = NewSubmit {
uuid: submit_id,
submit_time: submit_datetime,
requested_image_id: requested_image.id,
requested_package_id: requested_package.id,
repo_hash_id: repo_hash.id,
- tree: tree_json,
};
diesel::insert_into(submits::table)