From 74ca4377ff93215f7eb894561ce592c84c564780 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Wed, 26 Jul 2023 09:41:33 +0900 Subject: [PATCH] Drop the correct deleted branch table (#26028) There's a typo in #22743 The correct table name is `deleted_branch` not `deleted_branches` --- models/migrations/migrations.go | 2 ++ models/migrations/v1_21/v264.go | 2 +- models/migrations/v1_21/v269.go | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 models/migrations/v1_21/v269.go diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index fc11d5407..2b090a913 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -519,6 +519,8 @@ var migrations = []Migration{ NewMigration("Add action_tasks_version table", v1_21.CreateActionTasksVersionTable), // v268 -> v269 NewMigration("Update Action Ref", v1_21.UpdateActionsRefIndex), + // v269 -> v270 + NewMigration("Drop deleted branch table", v1_21.DropDeletedBranchTable), } // GetCurrentDBVersion returns the current db version diff --git a/models/migrations/v1_21/v264.go b/models/migrations/v1_21/v264.go index 60b7a7acf..e81a17ad6 100644 --- a/models/migrations/v1_21/v264.go +++ b/models/migrations/v1_21/v264.go @@ -89,5 +89,5 @@ func AddBranchTable(x *xorm.Engine) error { } } - return x.DropTables("deleted_branches") + return x.DropTables(new(DeletedBranch)) } diff --git a/models/migrations/v1_21/v269.go b/models/migrations/v1_21/v269.go new file mode 100644 index 000000000..475ec0238 --- /dev/null +++ b/models/migrations/v1_21/v269.go @@ -0,0 +1,12 @@ +// Copyright 2023 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +package v1_21 //nolint + +import ( + "xorm.io/xorm" +) + +func DropDeletedBranchTable(x *xorm.Engine) error { + return x.DropTables("deleted_branch") +}