Skip to content

Commit 7af6fc3

Browse files
committed
add build-server hostname to builds table
1 parent 247b602 commit 7af6fc3

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

Diff for: Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ rustwide = "0.15.0"
5353
mime_guess = "2"
5454
dotenv = "0.15"
5555
zstd = "0.11.0"
56+
hostname = "0.3.1"
5657
git2 = { version = "0.14.4", default-features = false }
5758
path-slash = "0.2.0"
5859
once_cell = { version = "1.4.0", features = ["parking_lot"] }

Diff for: src/db/add_package.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,15 @@ pub(crate) fn add_build_into_database(
186186
) -> Result<i32> {
187187
debug!("Adding build into database");
188188
let rows = conn.query(
189-
"INSERT INTO builds (rid, rustc_version, docsrs_version, build_status)
190-
VALUES ($1, $2, $3, $4)
189+
"INSERT INTO builds (rid, rustc_version, docsrs_version, build_status, build_server)
190+
VALUES ($1, $2, $3, $4, $5)
191191
RETURNING id",
192192
&[
193193
&release_id,
194194
&res.rustc_version,
195195
&res.docsrs_version,
196196
&res.successful,
197+
&hostname::get()?.to_str().unwrap_or(""),
197198
],
198199
)?;
199200
Ok(rows[0].get(0))

Diff for: src/db/migrate.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,13 @@ pub fn migrate(version: Option<Version>, conn: &mut Client) -> crate::error::Res
837837
)
838838
.map(|_| ())
839839
}
840-
)
840+
),
841+
sql_migration!(
842+
context, 33, "add hostname to build-table",
843+
"ALTER TABLE builds ADD COLUMN build_server TEXT NOT NULL DEFAULT '';",
844+
"ALTER TABLE builds DROP COLUMN build_server;",
845+
),
846+
841847
];
842848

843849
for migration in migrations {

0 commit comments

Comments
 (0)