Skip to content

Commit 0c6f85f

Browse files
Nemo157syphar
authored andcommitted
Don't write build_status to releases
1 parent 4389946 commit 0c6f85f

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ALTER TABLE releases ADD COLUMN build_status BOOL;
2+
3+
UPDATE releases SET build_status = (
4+
SELECT builds.build_status
5+
FROM builds
6+
WHERE builds.rid = releases.id
7+
ORDER BY builds.build_time DESC
8+
LIMIT 1
9+
);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE releases DROP COLUMN build_status;

src/db/add_package.rs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) async fn add_package_into_database(
5252
let release_id: i32 = sqlx::query_scalar!(
5353
"INSERT INTO releases (
5454
crate_id, version, release_time,
55-
dependencies, target_name, yanked, build_status,
55+
dependencies, target_name, yanked,
5656
rustdoc_status, test_status, license, repository_url,
5757
homepage_url, description, description_long, readme,
5858
keywords, have_examples, downloads, files,
@@ -63,42 +63,40 @@ pub(crate) async fn add_package_into_database(
6363
VALUES (
6464
$1, $2, $3, $4, $5, $6, $7, $8, $9,
6565
$10, $11, $12, $13, $14, $15, $16, $17, $18,
66-
$19, $20, $21, $22, $23, $24, $25, $26, $27
66+
$19, $20, $21, $22, $23, $24, $25, $26,
6767
)
6868
ON CONFLICT (crate_id, version) DO UPDATE
6969
SET release_time = $3,
7070
dependencies = $4,
7171
target_name = $5,
7272
yanked = $6,
73-
build_status = $7,
74-
rustdoc_status = $8,
75-
test_status = $9,
76-
license = $10,
77-
repository_url = $11,
78-
homepage_url = $12,
79-
description = $13,
80-
description_long = $14,
81-
readme = $15,
82-
keywords = $16,
83-
have_examples = $17,
84-
downloads = $18,
85-
files = $19,
86-
doc_targets = $20,
87-
is_library = $21,
88-
doc_rustc_version = $22,
89-
documentation_url = $23,
90-
default_target = $24,
91-
features = $25,
92-
repository_id = $26,
93-
archive_storage = $27
73+
rustdoc_status = $7,
74+
test_status = $8,
75+
license = $9,
76+
repository_url = $10,
77+
homepage_url = $11,
78+
description = $12,
79+
description_long = $13,
80+
readme = $14,
81+
keywords = $15,
82+
have_examples = $16,
83+
downloads = $17,
84+
files = $18,
85+
doc_targets = $19,
86+
is_library = $20,
87+
doc_rustc_version = $21,
88+
documentation_url = $22,
89+
default_target = $23,
90+
features = $24,
91+
repository_id = $25,
92+
archive_storage = $26
9493
RETURNING id",
9594
crate_id,
9695
&metadata_pkg.version,
9796
registry_data.release_time,
9897
serde_json::to_value(dependencies)?,
9998
metadata_pkg.package_name(),
10099
registry_data.yanked,
101-
res.successful,
102100
has_docs,
103101
false, // TODO: Add test status somehow
104102
metadata_pkg.license,

0 commit comments

Comments
 (0)