@@ -162,6 +162,7 @@ static MIGRATIONS: &[&str] = &[
162
162
PRIMARY KEY(aid, cid, crate)
163
163
);
164
164
"# ,
165
+ r#"alter table pull_request_builds rename to pull_request_build"# ,
165
166
] ;
166
167
167
168
#[ async_trait:: async_trait]
@@ -470,7 +471,7 @@ impl Connection for SqliteConnection {
470
471
) {
471
472
self . raw_ref ( )
472
473
. prepare_cached (
473
- "insert into pull_request_builds (pr, complete, requested, include, exclude, runs) VALUES (?, 0, strftime('%s','now'), ?, ?, ?)" ,
474
+ "insert into pull_request_build (pr, complete, requested, include, exclude, runs) VALUES (?, 0, strftime('%s','now'), ?, ?, ?)" ,
474
475
)
475
476
. unwrap ( )
476
477
. execute ( params ! [ pr, include, exclude, & runs] )
@@ -479,7 +480,7 @@ impl Connection for SqliteConnection {
479
480
async fn pr_attach_commit ( & self , pr : u32 , sha : & str , parent_sha : & str ) -> bool {
480
481
self . raw_ref ( )
481
482
. prepare_cached (
482
- "update pull_request_builds SET bors_sha = ?, parent_sha = ?
483
+ "update pull_request_build SET bors_sha = ?, parent_sha = ?
483
484
where pr = ? and bors_sha is null" ,
484
485
)
485
486
. unwrap ( )
@@ -490,7 +491,7 @@ impl Connection for SqliteConnection {
490
491
async fn queued_commits ( & self ) -> Vec < QueuedCommit > {
491
492
self . raw_ref ( )
492
493
. prepare_cached (
493
- "select pr, bors_sha, parent_sha, include, exclude, runs from pull_request_builds
494
+ "select pr, bors_sha, parent_sha, include, exclude, runs from pull_request_build
494
495
where complete is false and bors_sha is not null
495
496
order by requested asc" ,
496
497
)
@@ -514,7 +515,7 @@ impl Connection for SqliteConnection {
514
515
let count = self
515
516
. raw_ref ( )
516
517
. execute (
517
- "update pull_request_builds SET complete = 1 where sha = ? and complete = 0" ,
518
+ "update pull_request_build SET complete = 1 where sha = ? and complete = 0" ,
518
519
params ! [ sha] ,
519
520
)
520
521
. unwrap ( ) ;
@@ -524,7 +525,7 @@ impl Connection for SqliteConnection {
524
525
assert_eq ! ( count, 1 , "sha is unique column" ) ;
525
526
self . raw_ref ( )
526
527
. query_row (
527
- "select pr, sha, parent_sha, include, exclude, runs from pull_request_builds
528
+ "select pr, sha, parent_sha, include, exclude, runs from pull_request_build
528
529
where sha = ?" ,
529
530
params ! [ sha] ,
530
531
|row| {
@@ -867,7 +868,7 @@ impl Connection for SqliteConnection {
867
868
async fn parent_of ( & self , sha : & str ) -> Option < String > {
868
869
let mut shas = self
869
870
. raw_ref ( )
870
- . prepare_cached ( "select parent_sha from pull_request_builds where bors_sha = ?" )
871
+ . prepare_cached ( "select parent_sha from pull_request_build where bors_sha = ?" )
871
872
. unwrap ( )
872
873
. query ( params ! [ sha] )
873
874
. unwrap ( )
@@ -880,7 +881,7 @@ impl Connection for SqliteConnection {
880
881
async fn pr_of ( & self , sha : & str ) -> Option < u32 > {
881
882
self . raw_ref ( )
882
883
. query_row (
883
- "select pr from pull_request_builds where bors_sha = ?" ,
884
+ "select pr from pull_request_build where bors_sha = ?" ,
884
885
params ! [ sha] ,
885
886
|row| Ok ( row. get ( 0 ) . unwrap ( ) ) ,
886
887
)
0 commit comments