{"category_id":"repository","default_severity":"warning","description":"A Git comparison adding multiple logical SQL revisions in one migration stream needs consolidation review. Conventional migrations directories, migration-set components and configured review-policy migration roots identify separate streams. Automatic discovery excludes test, fixture, example, vendor and generated paths; explicit manifest roots remain authoritative. Base stream roots retain their ownership: head changes cannot remove them or split them into child streams. New roots outside those streams remain independent. A new direct SQL file sharing a 14-digit version also warns when both files carry dbmate up and down directives. The comparison targets newly added filenames.","examples":[{"after":"{\"base\":[],\"head\":[\"db/migrations/001.sql\"]}","before":"{\"base\":[],\"head\":[\"db/migrations/001.sql\",\"db/migrations/002.sql\"]}","expected_severity":"warning","id":"sarj-migration-consolidation","language":"json","title":"One new logical SQL revision per stream"}],"fix":"Combine compatible new revisions in their original statement order, preserve framework metadata and rollback contracts, and rerun against the pull-request base. Do not rewrite applied history. Retain necessary boundaries with an exact reviewed exception. For a duplicate dbmate version, assign an unused version to the unapplied file and update references to its path. Direct SQL files, up/down pairs, Flyway V/U versions and Prisma revision directories are recognized; repeatable Flyway R__ scripts and other nested layouts are outside this rule.","kind":"rule","references":[],"rule_id":"repository/artifacts/migration-consolidation","rule_version":2,"slug":"migration-consolidation","source":{"path":"src/repo_standards/policy_sarj/policy.py","symbol":"repository/artifacts/migration-consolidation"},"title":"Review new SQL revisions and duplicate dbmate versions within a stream","topic_id":"artifacts","why":"Separate unapplied migrations from one change add needless history and execution boundaries. Required transaction, rollback and deployment boundaries can still justify multiple revisions, so filenames alone support a warning rather than proving that concatenation is safe. dbmate records the leading numeric version, so duplicate versions can skip a migration on upgrade or fail a fresh migration run."}
