@@ -218,8 +218,8 @@ struct Error;
218
218
219
219
#[ derive( Serialize ) ]
220
220
struct ErrorRow < ' a > {
221
- benchmark : & ' a str ,
222
221
aid : i32 ,
222
+ benchmark : & ' a str ,
223
223
error : Nullable < & ' a str > ,
224
224
}
225
225
@@ -229,7 +229,7 @@ impl Table for Error {
229
229
}
230
230
231
231
fn sqlite_attributes ( ) -> & ' static str {
232
- "benchmark, aid , error"
232
+ "aid, benchmark , error"
233
233
}
234
234
235
235
fn postgres_generated_id_attribute ( ) -> Option < & ' static str > {
@@ -239,8 +239,8 @@ impl Table for Error {
239
239
fn write_postgres_csv_row < W : Write > ( writer : & mut csv:: Writer < W > , row : & rusqlite:: Row ) {
240
240
writer
241
241
. serialize ( ErrorRow {
242
- benchmark : row. get_ref ( 0 ) . unwrap ( ) . as_str ( ) . unwrap ( ) ,
243
- aid : row. get ( 1 ) . unwrap ( ) ,
242
+ aid : row. get ( 0 ) . unwrap ( ) ,
243
+ benchmark : row. get_ref ( 1 ) . unwrap ( ) . as_str ( ) . unwrap ( ) ,
244
244
error : row. get_ref ( 2 ) . unwrap ( ) . try_into ( ) . unwrap ( ) ,
245
245
} )
246
246
. unwrap ( ) ;
@@ -333,6 +333,7 @@ struct PullRequestBuildRow<'a> {
333
333
include : Nullable < & ' a str > ,
334
334
exclude : Nullable < & ' a str > ,
335
335
runs : Nullable < i32 > ,
336
+ commit_date : Nullable < DateTime < Utc > > ,
336
337
}
337
338
338
339
impl Table for PullRequestBuild {
@@ -341,7 +342,7 @@ impl Table for PullRequestBuild {
341
342
}
342
343
343
344
fn sqlite_attributes ( ) -> & ' static str {
344
- "bors_sha, pr, parent_sha, complete, requested, include, exclude, runs"
345
+ "bors_sha, pr, parent_sha, complete, requested, include, exclude, runs, commit_date "
345
346
}
346
347
347
348
fn postgres_generated_id_attribute ( ) -> Option < & ' static str > {
@@ -350,6 +351,7 @@ impl Table for PullRequestBuild {
350
351
351
352
fn write_postgres_csv_row < W : Write > ( writer : & mut csv:: Writer < W > , row : & rusqlite:: Row ) {
352
353
let requested: Option < i64 > = row. get ( 4 ) . unwrap ( ) ;
354
+ let commit_date: Option < i64 > = row. get ( 8 ) . unwrap ( ) ;
353
355
354
356
writer
355
357
. serialize ( PullRequestBuildRow {
@@ -363,6 +365,9 @@ impl Table for PullRequestBuild {
363
365
include : row. get_ref ( 5 ) . unwrap ( ) . try_into ( ) . unwrap ( ) ,
364
366
exclude : row. get_ref ( 6 ) . unwrap ( ) . try_into ( ) . unwrap ( ) ,
365
367
runs : row. get ( 7 ) . unwrap ( ) ,
368
+ commit_date : Nullable (
369
+ commit_date. map ( |seconds| Utc . timestamp_opt ( seconds, 0 ) . unwrap ( ) ) ,
370
+ ) ,
366
371
} )
367
372
. unwrap ( ) ;
368
373
}
0 commit comments