1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-01-21 16:55:06 -05:00
forgejo/models/migrations/v1_23
Earl Warren 376a2e19ea fix: reduce noise for the v303 migration (#6591)
Using SELECT `%s` FROM `%s` WHERE 0 = 1 to assert the existence of a column is simple but noisy: it shows errors in the migrations that are confusing for Forgejo admins because they are not actual errors.

Use introspection instead, which is more complicated but leads to the same result.

Add a test that ensures it works as expected, for all database types. Although the migration is run for all database types, it does not account for various scenarios and is never tested in the case a column does not exist.

Refs: https://codeberg.org/forgejo/forgejo/issues/6583

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6591
Reviewed-by: Otto <otto@codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-01-17 07:42:20 +00:00
..
main_test.go [CHORE] Move test related function to own package 2024-07-14 17:00:49 +02:00
v299.go Prevent simultaneous editing of comments and issues (#31053) 2024-06-02 16:26:54 +02:00
v300.go Allow force push to protected branches (#28086) (migration v300) 2024-08-04 18:24:10 +02:00
v301.go add skip secondary authorization option for public oauth2 clients (#31454) (migration v301) 2024-08-04 18:24:10 +02:00
v302.go Clear up old Actions logs (#31735) 2024-08-04 18:24:10 +02:00
v303.go fix: reduce noise for the v303 migration (#6591) 2025-01-17 07:42:20 +00:00
v303_test.go fix: reduce noise for the v303 migration (#6591) 2025-01-17 07:42:20 +00:00