This commit is contained in:
Ian Gulliver
2026-10-21 09:05:33 -07:00
parent cdfc148ba9
commit a977c3cad9
2 changed files with 28 additions and 40 deletions
+5 -2
View File
@@ -102,7 +102,10 @@ func migratePrefixIDs(tx *sql.Tx, dataDir string) error {
}
func idRenames(tx *sql.Tx) (map[string]string, error) {
sources := []struct{ prefix, query string }{
sources := []struct {
prefix ids.Prefix
query string
}{
{ids.Project, `SELECT id FROM projects`},
{ids.Task, `SELECT id FROM tasks`},
{ids.WorkflowRun, `SELECT DISTINCT workflow_run FROM tasks`},
@@ -133,7 +136,7 @@ func idRenames(tx *sql.Tx) (map[string]string, error) {
return nil, err
}
_, mapped := renames[old]
if old == "" || mapped || strings.HasPrefix(old, src.prefix) {
if old == "" || mapped || strings.HasPrefix(old, string(src.prefix)) {
continue
}
renames[old] = ids.Derive(src.prefix, old)