Przeglądaj źródła

handle repository.size column being NULL in migration v263 (#28336) (#28363)

Co-authored-by: Nate Levesque <nate@thenaterhood.com>
tags/v1.21.2
Giteabot 6 miesięcy temu
rodzic
commit
5b5f8aab19
No account linked to committer's email address
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6
    1
      models/migrations/v1_21/v263.go

+ 6
- 1
models/migrations/v1_21/v263.go Wyświetl plik

@@ -32,7 +32,12 @@ func AddGitSizeAndLFSSizeToRepositoryTable(x *xorm.Engine) error {
return err
}

_, err = sess.Exec(`UPDATE repository SET git_size = size - lfs_size`)
_, err = sess.Exec(`UPDATE repository SET size = 0 WHERE size IS NULL`)
if err != nil {
return err
}

_, err = sess.Exec(`UPDATE repository SET git_size = size - lfs_size WHERE size > lfs_size`)
if err != nil {
return err
}

Ładowanie…
Anuluj
Zapisz