{"record":{"id":"4670eede7c262902","repo":"ory/hydra","slug":"invalid-database-type-q-expected-all-because-f","errorCode":null,"errorMessage":"invalid database type %q, expected \"all\" because fizz is database type independent","messagePattern":"invalid database type %q, expected \"all\" because fizz is database type independent","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"oryx/popx/match.go","lineNumber":80,"sourceCode":"\t} else {\n\t\tdbType = strings.TrimPrefix(m[dbTypeIdx], \".\")\n\t\t// The commercial package registers this dialect from init(), but\n\t\t// migration boxes can be constructed before that package enters the\n\t\t// import graph. Canonicalize both accepted spellings independently of\n\t\t// registration so migration selection is deterministic in every build.\n\t\tswitch dbType {\n\t\tcase dbal.DriverYugabyteDB, \"yugabytedb\":\n\t\t\tdbType = dbal.DriverYugabyteDB\n\t\tdefault:\n\t\t\tdbType = pop.CanonicalDialect(dbType)\n\t\t}\n\t\tif dbType != dbal.DriverYugabyteDB && !pop.DialectSupported(dbType) {\n\t\t\treturn nil, errors.Wrapf(errUnsupportedMigrationDialect, \"%s\", dbType)\n\t\t}\n\t}\n\n\tif m[typeIdx] == \"fizz\" && dbType != \"all\" {\n\t\treturn nil, errors.Errorf(\"invalid database type %q, expected \\\"all\\\" because fizz is database type independent\", dbType)\n\t}\n\n\tif m[autocommitIdx] == \".autocommit\" {\n\t\tautocommit = true\n\t} else if m[autocommitIdx] != \"\" {\n\t\treturn nil, errors.Errorf(\"invalid autocommit flag %q\", m[autocommitIdx])\n\t}\n\n\treturn &match{\n\t\tVersion:    m[versionIdx],\n\t\tName:       m[nameIdx],\n\t\tDBType:     dbType,\n\t\tAutocommit: autocommit,\n\t\tDirection:  m[directionIdx],\n\t\tType:       m[typeIdx],\n\t}, nil\n}\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/ory/hydra/blob/4174065ffb052799890f7480f5360a877a67ffc1/oryx/popx/match.go#L62-L98","documentation":"Fizz migrations are dialect-independent, so they must be named with the \"all\" database type. parseMigrationFilename throws this error (oryx/popx/match.go:79) when the migration type segment is \"fizz\" but the filename declares a specific dialect, because fizz cannot be filtered by dialect.","triggerScenarios":"A filename like 20210101000000_name.postgres.fizz.up.fizz or otherwise with type=fizz while the dialect segment is a concrete dialect (e.g. .postgres.) instead of empty/all.","commonSituations":"Hand-edited migration filenames; converting a fizz migration by adding a dialect segment; tooling that generates filenames with wrong group ordering.","solutions":["Remove the dialect segment so fizz migrations use the \"all\" database type, e.g. 20210101000000_name.fizz.up.sql","If the migration is dialect-specific, rewrite the content as SQL and keep the dialect segment with type sql instead of fizz"],"exampleFix":"// before\n20210101000000_create_table.postgres.fizz.up.fizz  (fizz with .postgres. segment)\n// after\n20210101000000_create_table.fizz.up.fizz","handlingStrategy":"validation","validationCode":"re := regexp.MustCompile(`^(\\d+)_([^.]+)(\\.[a-z0-9]+)?(\\.autocommit)?\\.(up|down)\\.(sql)$`)\nm := re.FindStringSubmatch(filename)\nif m != nil && strings.HasSuffix(filename, \".fizz\") && m[3] != \"\" && m[3] != \".autocommit\" {\n    return fmt.Errorf(\"fizz migration %q must not declare a dialect\", filename)\n}","typeGuard":null,"tryCatchPattern":"if _, err := parseMigrationFilename(name); err != nil {\n    if strings.Contains(err.Error(), \"fizz is database type independent\") {\n        return fmt.Errorf(\"fix filename %s: fizz migrations need no dialect segment\", name)\n    }\n    return err\n}","preventionTips":["Remember fizz migrations are dialect-independent: name them without a dialect segment","Lint migration filenames in CI to catch fizz+dialect combinations before deployment"],"tags":["migrations","fizz","file-naming","database"],"backgroundTag":"invalid-migration-filename","analyzedSha":"4174065ffb052799890f7480f5360a877a67ffc1","analyzedAt":"2026-09-03T14:52:41.581Z","contentChangedAt":"2026-09-03T14:52:41.581Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}