1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2025-07-12 22:21:40 +02:00

add migration function to remove null repo counters

This commit is contained in:
Brad Rydzewski
2017-05-25 12:25:16 +02:00
parent 62876d6ad9
commit ee54698c62
6 changed files with 42 additions and 0 deletions

View File

@ -104,6 +104,10 @@ var migrations = []struct {
name: "update-table-set-repo-seq",
stmt: updateTableSetRepoSeq,
},
{
name: "update-table-set-repo-seq-default",
stmt: updateTableSetRepoSeqDefault,
},
}
// Migrate performs the database migration. If the migration fails
@ -490,3 +494,8 @@ UPDATE repos SET repo_counter = (
WHERE builds.build_repo_id = repos.repo_id
)
`
var updateTableSetRepoSeqDefault = `
UPDATE repos SET repo_counter = 0
WHERE repo_counter IS NULL
`