mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-22 09:27:18 +00:00
Adds four foreign keys: - stopwatch -- issue_id -> issue, user_id -> user - tracked_time -- issue_id -> issue, user_id -> user The majority of work encompassed in this PR is updating testing and support infrastructure to support foreign keys: - `models/db/foreign_keys.go` adds new capabilities to sort registered tables into the right insertion order to avoid violating foreign keys - `RecreateTables`, used by migration testing and the `doctor recreate-table` CLI, has been updated to support tables with foreign keys; new restrictions require that FK-related tables be rebuilt at the same time - test fixture data is inserted in foreign-key order, and deleted in the reverse An upgrade to xorm v1.3.9-forgejo.2 is incorporated in this PR, as two unexpected behaviors in the foreign key schema management were discovered during development of the updated `RecreateTables` routine. Work in this PR is laid out to be reviewed easier commit-by-commit. ## Checklist The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org). ### Tests - I added test coverage for Go changes... - [x] in their respective `*_test.go` for unit tests. - [x] in the `tests/integration` directory if it involves interactions with a live Forgejo server. - I added test coverage for JavaScript changes... - [ ] in `web_src/js/*.test.js` if it can be unit tested. - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)). ### Documentation - [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change. - [x] I did not document these changes and I do not expect someone else to do it. ### Release notes - [ ] I do not want this change to show in the release notes. - [ ] I want the title to show in the release notes with a link to this pull request. - [x] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9373 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net> |
||
|---|---|---|
| .. | ||
| 3139.md | ||
| 3285.md | ||
| 3307.md | ||
| 3334.md | ||
| 3337.md | ||
| 3363.md | ||
| 3383.md | ||
| 3414.md | ||
| 3430.md | ||
| 3434.md | ||
| 3442.md | ||
| 3642.md | ||
| 3654.md | ||
| 3723.md | ||
| 3724.md | ||
| 3729.md | ||
| 3752.md | ||
| 3791.md | ||
| 3808.md | ||
| 3811.md | ||
| 3830.md | ||
| 3836.md | ||
| 3838.md | ||
| 3847.md | ||
| 3870.md | ||
| 3886.md | ||
| 3917.md | ||
| 3922.md | ||
| 3934.md | ||
| 3985.md | ||
| 3989.md | ||
| 4026.md | ||
| 4027.md | ||
| 4072.md | ||
| 4083.md | ||
| 4095.md | ||
| 4125.md | ||
| 4134.md | ||
| 4136.md | ||
| 4139.md | ||
| 4143.md | ||
| 4145.md | ||
| 4160.md | ||
| 4189.md | ||
| 4201.md | ||
| 4212.md | ||
| 4218.md | ||
| 4222.md | ||
| 4240.md | ||
| 4253.md | ||
| 4262.md | ||
| 4266.md | ||
| 4291.md | ||
| 4367.md | ||
| 4375.md | ||
| 4400.md | ||
| 4427.md | ||
| 4429.md | ||
| 4439.md | ||
| 4487.md | ||
| 4506.md | ||
| 4547.md | ||
| 4595.md | ||
| 4605.md | ||
| 4607.md | ||
| 4635.md | ||
| 4684.md | ||
| 4716.md | ||
| 4724.md | ||
| 4801.md | ||
| 4819.md | ||
| 4907.md | ||
| 4924.md | ||
| 4941.md | ||
| 4998.md | ||
| 5065.md | ||
| 5090.md | ||
| 5109.md | ||
| 5120.md | ||
| 5149.md | ||
| 5195.md | ||
| 5205.md | ||
| 5325.md | ||
| 5372.md | ||
| 5416.md | ||
| 5459.md | ||
| 5477.md | ||
| 5515.md | ||
| 5543.md | ||
| 5601.md | ||
| 5621.md | ||
| 5677.md | ||
| 5714.md | ||
| 5718.md | ||
| 5719.md | ||
| 5751.md | ||
| 5778.md | ||
| 5789.md | ||
| 5974.md | ||
| 5988.md | ||
| 5997.md | ||
| 6062.md | ||
| 6110.md | ||
| 6200.md | ||
| 6271.md | ||
| 6351.md | ||
| 6445.md | ||
| 6471.md | ||
| 6523.md | ||
| 6639.md | ||
| 6763.md | ||
| 6813.md | ||
| 6933.md | ||
| 7251.md | ||
| 8035.md | ||
| 8502.md | ||
| 9023.md | ||
| 9362.md | ||
| 9373.md | ||