Skip to content

Commit 5dbd676

Browse files
committed
Save rustc version for releases
1 parent 027a1ea commit 5dbd676

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/db/add_package.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ pub fn add_package_into_database(conn: &Connection,
4949
rustdoc_status, test_status, license, repository_url, \
5050
homepage_url, description, description_long, readme, \
5151
authors, keywords, have_examples, downloads, files, \
52-
doc_targets, is_library \
52+
doc_targets, is_library, doc_rustc_version \
5353
) \
5454
VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, \
5555
$11, $12, $13, $14, $15, $16, $17, $18, $19, \
56-
$20, $21, $22 \
56+
$20, $21, $22, $23 \
5757
) \
5858
RETURNING id",
5959
&[&crate_id,
@@ -77,7 +77,8 @@ pub fn add_package_into_database(conn: &Connection,
7777
&downloads,
7878
&files,
7979
&doc_targets.to_json(),
80-
&is_library]));
80+
&is_library,
81+
&res.rustc_version]));
8182
// return id
8283
rows.get(0).get(0)
8384

@@ -88,6 +89,7 @@ pub fn add_package_into_database(conn: &Connection,
8889
homepage_url = $12, description = $13, description_long = $14, \
8990
readme = $15, authors = $16, keywords = $17, have_examples = $18, \
9091
downloads = $19, files = $20, doc_targets = $21, is_library = $22 \
92+
doc_rustc_version = $23 \
9193
WHERE crate_id = $1 AND version = $2",
9294
&[&crate_id,
9395
&format!("{}", pkg.manifest().version()),
@@ -110,7 +112,7 @@ pub fn add_package_into_database(conn: &Connection,
110112
&downloads,
111113
&files,
112114
&doc_targets.to_json(),
113-
&is_library]));
115+
&res.rustc_version]));
114116
rows.get(0).get(0)
115117
}
116118
};

src/db/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub fn create_tables(conn: &Connection) -> Result<(), Error> {
6161
downloads INT DEFAULT 0, \
6262
files JSON, \
6363
doc_targets JSON DEFAULT '[]', \
64+
doc_rustc_version VARCHAR(100) NOT NULL, \
6465
UNIQUE (crate_id, version) \
6566
)",
6667
"CREATE TABLE authors ( \

0 commit comments

Comments
 (0)