Delete Labels & IssueLabels on Repo Delete too (#15039)

* Doctor: find IssueLabels without existing label

* on Repo Delete: delete labels & issue_labels too

* performance nits

* Add Migration: Delete orphaned IssueLabels

* Migration v174: use Sync2

* USE sess !!!

* better func name

* code format & comment

* RAW SQL

* Update models/migrations/v176.go

* next try?
This commit is contained in:
6543 2021-03-19 20:01:24 +01:00 committed by GitHub
parent dace0ce1b1
commit a3a65137ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 116 additions and 9 deletions

View file

@ -295,11 +295,13 @@ var migrations = []Migration{
// v173 -> v174
NewMigration("Add time_id column to Comment", addTimeIDCommentColumn),
// v174 -> v175
NewMigration("create repo transfer table", addRepoTransfer),
NewMigration("Create repo transfer table", addRepoTransfer),
// v175 -> v176
NewMigration("Fix Postgres ID Sequences broken by recreate-table", fixPostgresIDSequences),
// v176 -> v177
NewMigration("Remove invalid labels from comments", removeInvalidLabels),
// v177 -> v178
NewMigration("Delete orphaned IssueLabels", deleteOrphanedIssueLabels),
}
// GetCurrentDBVersion returns the current db version