sqlite: stop migrations clobbering pinned/template

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Jordan Hubbard
2025-12-26 12:04:06 -04:00
parent 1f5ed550fe
commit 59413baac2
6 changed files with 275 additions and 117 deletions

View File

@@ -21,6 +21,11 @@ func MigrateIsTemplateColumn(db *sql.DB) error {
}
if columnExists {
// Column exists (e.g. created by new schema); ensure index exists.
_, err = db.Exec(`CREATE INDEX IF NOT EXISTS idx_issues_is_template ON issues(is_template) WHERE is_template = 1`)
if err != nil {
return fmt.Errorf("failed to create is_template index: %w", err)
}
return nil
}