Skip to content

Commit 9e9df02

Browse files
committed
support replaces
1 parent 9ec24eb commit 9e9df02

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/metadata.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ CREATE TABLE packages (
5858
provides JSONB,
5959
snapshots JSONB,
6060
repology JSONB,
61+
replaces JSONB,
6162
download_count INTEGER,
6263
download_count_week INTEGER,
6364
download_count_month INTEGER,

src/models.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,5 @@ pub struct RemotePackage {
199199

200200
pub repology: Option<Vec<String>>,
201201
pub snapshots: Option<Vec<String>>,
202+
pub replaces: Option<Vec<String>>,
202203
}

src/repository.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ impl<'a> PackageRepository<'a> {
7575
let categories = serde_json::to_string(&package.categories).unwrap();
7676
let snapshots = serde_json::to_string(&package.snapshots).unwrap();
7777
let repology = serde_json::to_string(&package.repology).unwrap();
78+
let replaces = serde_json::to_string(&package.replaces).unwrap();
7879

7980
let provides = package.provides.clone().map(|vec| {
8081
vec.iter()
@@ -132,6 +133,7 @@ impl<'a> PackageRepository<'a> {
132133
provides,
133134
snapshots,
134135
repology,
136+
replaces,
135137
package.download_count,
136138
package.download_count_week,
137139
package.download_count_month

src/statements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ impl<'a> Statements<'a> {
3232
bsum, shasum, icon, desktop, appstream, homepages, notes,
3333
source_urls, tags, categories, build_id, build_date,
3434
build_action, build_script, build_log, provides, snapshots,
35-
repology, download_count, download_count_week,
35+
repology, replaces, download_count, download_count_week,
3636
download_count_month
3737
)
3838
VALUES
3939
(
4040
?1, jsonb(?2), ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13,
4141
jsonb(?14), ?15, ?16, ?17, ?18, jsonb(?19), ?20, ?21, ?22, ?23, ?24, ?25,
4242
?26, jsonb(?27), jsonb(?28), jsonb(?29), jsonb(?30), jsonb(?31), ?32, ?33, ?34, ?35, ?36,
43-
jsonb(?37), jsonb(?38), jsonb(?39), ?40, ?41, ?42
43+
jsonb(?37), jsonb(?38), jsonb(?39), jsonb(?40), ?41, ?42, ?43
4444
)
4545
ON CONFLICT (pkg_id, pkg_name, version) DO NOTHING",
4646
)?,

0 commit comments

Comments
 (0)