fix: add structural guard for migration 008 in migrate.sh

This commit is contained in:
Pontoporeia
2026-04-15 12:51:31 +02:00
parent 0cb4451218
commit 6f04514aa2
3 changed files with 6 additions and 0 deletions

View File

@@ -52,6 +52,12 @@ already_applied_structurally() {
count=$(sqlite3 "$db" "SELECT COUNT(*) FROM sqlite_master WHERE type='index' AND name='idx_theses_pub_year';")
[ "$count" -eq 1 ]
;;
008_formulaire_settings.sql)
# Effect: site_settings table exists + show_contact column on authors
tbl=$(sqlite3 "$db" "SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='site_settings';")
col=$(sqlite3 "$db" "SELECT COUNT(*) FROM pragma_table_info('authors') WHERE name='show_contact';")
[ "$tbl" -eq 1 ] && [ "$col" -eq 1 ]
;;
*)
# Unknown migration — assume not applied
return 1

Binary file not shown.

0
test.db Normal file
View File