0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-22 22:06:21 -05:00
forgejo/models/migrations
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
..
base
fixtures feat: migrate TOTP secrets to keying 2024-11-27 00:34:16 +01:00
test
v1_6
v1_7
v1_8
v1_9
v1_10
v1_11
v1_12
v1_13
v1_14
v1_15
v1_16
v1_17
v1_18
v1_19
v1_20
v1_21
v1_22
v1_23 fix: reduce noise for the v303 migration (#6591) 2025-01-17 07:42:20 +00:00
migrations.go fix: keying SQLite migration 2024-12-24 10:05:59 +01:00
migrations_test.go