Trung Hehe
6bc92f464a
fix(org): enforce unique team names in the database ( #40228 )
...
Concurrent requests could create teams with the same name in one
organization, because only the service checked the name. Editing such a
team, or renaming a team to a taken name, then failed with a 500.
- Add a unique index on `team (org_id, lower_name)`. Migration 368
renames every duplicate except the oldest to a free `<name>-<n>` and
logs each rename. IDs, members, repositories and permissions are kept,
but lookups by the old name (CODEOWNERS, group-to-team sync, mentions,
URLs) now reach only the kept team.
- Team writes report a name rejected by the index as
`ErrTeamAlreadyExist`, so duplicates, concurrent ones included, return
409 from `POST /orgs/{org}/teams` (previously 422) and `PATCH
/teams/{id}`, and a form error in the web UI.
Fixes https://github.com/go-gitea/gitea/issues/39632
---------
Co-authored-by: silverwind <me@silverwind.io >
2026-11-07 11:16:11 +00:00
..
2026-11-06 08:23:13 +00:00
2026-10-18 12:56:04 +00:00
2026-09-26 22:52:19 +00:00
2026-09-26 07:42:36 +00:00
2026-10-24 13:48:19 +00:00
2026-10-31 14:28:58 +00:00
2026-10-30 18:54:07 +00:00
2026-10-18 12:56:04 +00:00
2026-05-26 15:49:31 -07:00
2026-09-30 21:42:07 -06:00
2026-09-26 08:01:41 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-22 01:48:49 +00:00
2026-10-24 13:48:19 +00:00
2026-10-18 07:08:55 +00:00
2026-10-24 13:48:19 +00:00
2026-10-30 21:41:59 +00:00
2026-08-07 20:56:40 -07:00
2026-10-24 13:48:19 +00:00
2026-07-25 21:31:19 +00:00
2026-10-22 01:48:49 +00:00
2026-10-31 17:31:59 +01:00
2026-11-06 08:08:20 +00:00
2026-05-26 15:49:31 -07:00
2026-11-04 17:24:33 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-06-27 12:09:01 +00:00
2026-08-29 07:50:04 +00:00
2026-10-31 09:31:56 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-31 13:03:59 +01:00
2026-10-24 13:48:19 +00:00
2026-11-04 17:34:29 +00:00
2026-10-24 13:48:19 +00:00
2026-10-31 12:30:07 +00:00
2026-05-26 15:49:31 -07:00
2026-11-07 09:34:21 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-06-10 17:34:10 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-09-06 09:49:27 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-27 21:40:42 +01:00
2026-10-31 17:31:55 +01:00
2026-05-26 15:49:31 -07:00
2026-10-21 18:52:33 +08:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-27 21:40:42 +01:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-07-16 11:51:36 +02:00
2026-10-24 13:48:19 +00:00
2026-07-28 17:04:22 +00:00
2026-11-05 15:19:09 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-11-04 01:42:41 +00:00
2026-10-24 13:48:19 +00:00
2026-10-29 18:10:36 +00:00
2026-10-19 00:34:01 +00:00
2026-10-24 13:48:19 +00:00
2026-08-09 12:55:43 +00:00
2026-10-24 13:48:19 +00:00
2026-10-01 07:50:47 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-08-24 07:28:17 +00:00
2026-10-24 13:48:19 +00:00
2026-11-07 10:45:05 +00:00
2026-08-24 18:26:10 +00:00
2026-10-24 13:48:19 +00:00
2026-08-24 07:28:17 +00:00
2026-10-24 13:48:19 +00:00
2026-10-23 01:53:45 +00:00
2026-10-23 01:53:45 +00:00
2026-10-24 13:48:19 +00:00
2026-10-31 17:31:39 +01:00
2026-11-05 18:26:32 +00:00
2026-05-26 15:49:31 -07:00
2026-11-06 08:23:13 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-19 09:15:41 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-07-28 17:04:22 +00:00
2026-08-03 06:41:27 +00:00
2026-08-03 06:41:27 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 00:18:51 +00:00
2026-10-18 12:56:04 +00:00
2026-10-24 13:48:19 +00:00
2026-09-29 14:43:36 +02:00
2026-10-24 13:48:19 +00:00
2026-10-18 12:56:04 +00:00
2026-05-26 15:49:31 -07:00
2026-11-04 17:34:29 +00:00
2026-05-26 15:49:31 -07:00
2026-08-23 06:35:55 +00:00
2026-10-30 20:37:37 +00:00
2026-10-24 13:48:19 +00:00
2026-11-04 17:34:29 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-11-07 11:16:11 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-30 06:35:11 +08:00
2026-10-19 00:34:01 +00:00
2026-05-26 15:49:31 -07:00
2026-06-08 16:58:42 +08:00
2026-10-24 13:48:19 +00:00
2026-10-19 00:34:01 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-11-01 06:57:30 +00:00
2026-10-24 13:48:19 +00:00
2026-08-22 08:08:36 +00:00
2026-10-24 13:48:19 +00:00
2026-11-03 16:20:39 +00:00
2026-11-07 09:43:39 +00:00
2026-08-14 02:15:33 +00:00
2026-10-24 13:48:19 +00:00
2023-06-29 23:22:55 +00:00
2026-10-14 07:19:49 +00:00
2026-10-24 13:48:19 +00:00
2026-06-29 15:10:47 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-10-02 21:08:14 +02:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-04 16:26:14 +08:00
2026-10-24 13:48:19 +00:00
2026-10-24 01:15:31 +00:00
2026-11-06 08:08:20 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-31 13:03:59 +01:00
2026-11-06 08:08:20 +00:00
2026-10-05 05:25:54 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-11-07 03:20:25 +00:00
2026-10-19 00:34:01 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-08-29 19:54:07 +00:00
2026-10-24 13:48:19 +00:00
2026-06-18 12:02:11 +00:00
2026-10-24 13:48:19 +00:00
2026-10-18 12:56:04 +00:00
2026-07-12 17:14:09 +00:00
2026-10-30 06:35:11 +08:00
2026-05-26 15:49:31 -07:00
2026-07-31 11:05:41 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-28 20:38:45 +08:00
2026-11-02 19:30:55 +00:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-11-06 08:23:13 +00:00
2026-10-31 17:47:36 +00:00
2026-05-26 15:49:31 -07:00
2026-10-31 18:20:56 +01:00
2026-08-21 07:28:23 +00:00
2026-05-26 15:49:31 -07:00
2026-08-17 20:30:24 +00:00
2026-10-24 13:48:19 +00:00
2026-08-17 20:30:24 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2022-09-02 15:18:23 -04:00
2026-11-04 01:42:41 +00:00
2026-11-06 20:45:17 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-11-05 21:58:17 +00:00
2026-09-02 17:07:04 +00:00
2026-10-30 20:18:13 +00:00
2026-11-06 08:08:20 +00:00
2026-11-06 07:31:58 +00:00
2026-10-06 17:28:28 +00:00
2026-10-19 00:34:01 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-10-24 13:48:19 +00:00
2026-10-28 20:38:45 +08:00
2026-08-10 01:25:31 +00:00
2026-05-26 15:49:31 -07:00
2026-11-01 06:27:12 +00:00
2026-10-30 17:28:47 +00:00
2026-05-26 15:49:31 -07:00
2026-10-19 00:34:01 +00:00
2026-10-24 13:48:19 +00:00
2026-10-31 14:51:43 +00:00
2026-10-28 20:38:45 +08:00
2026-10-28 09:19:35 +00:00
2026-11-06 11:59:49 +00:00
2026-10-24 13:48:19 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-11-04 17:25:51 +00:00
2026-10-24 13:48:19 +00:00
2026-10-02 21:08:14 +02:00
2026-10-24 13:48:19 +00:00
2026-10-24 13:48:19 +00:00
2026-10-02 22:21:41 +08:00
2026-08-27 16:34:44 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-11-04 01:42:41 +00:00
2026-11-04 01:42:41 +00:00
2026-11-04 18:11:25 +00:00
2026-10-05 19:12:22 +02:00
2026-10-29 05:18:17 +00:00
2026-11-02 14:30:41 +00:00
2026-10-19 00:34:01 +00:00