Migration Files

Naming

A migration is a file named .sql. The part before the extension is parsed as a strict SemVer 2.0.0 version, and that version is the migration’s identity — it’s what gets recorded, compared, and ordered.

File Valid Why
1.0.0.sql Yes
0.1.0.sql Yes
1.36.3.sql Yes
2.0.0-beta.1.sql Yes Pre-release identifiers are allowed
1.0.sql No SemVer requires all three components
v1.0.0.sql No No prefixes
01.0.0.sql No No leading zeros
20260725.sql No Not a SemVer version
1.0.0+build.5.sql No Build metadata is rejected — see below

Build metadata (the +… suffix) is rejected deliberately. SemVer says it is ignored when determining precedence, so 1.0.0+a.sql and 1.0.0+b.sql would be two distinct files that tie exactly — there’d be no defined order between them and no way to tell which one a recorded version referred to.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论