Skip to content

Commit 22cf15e

Browse files
committed
docs: improve description for Migration File Names
1 parent 0a6b39d commit 22cf15e

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

user_guide_src/source/dbmgmt/migration.rst

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,28 @@ include migrations from all namespaces.
2222
Migration File Names
2323
********************
2424

25-
Each Migration is run in numeric order forward or backwards depending on the
26-
method taken. Each migration is numbered using the timestamp when the migration
27-
was created, in **YYYY-MM-DD-HHIISS** format (e.g., **2012-10-31-100537**). This
28-
helps prevent numbering conflicts when working in a team environment.
25+
A migration file name is made up of a timestamp prefix, an underscore (``_``),
26+
and a descriptive name (classname).
27+
28+
* 2024-09-08-013653_AddBlogTable.php
29+
30+
Each migration is numbered using the timestamp (**2024-09-08-013653**) when the
31+
migration was created, in **YYYY-MM-DD-HHIISS** format.
2932

30-
Prefix your migration files with the migration number followed by an underscore
31-
and a descriptive name for the migration. The year, month, and date can be separated
32-
from each other by dashes, underscores, or not at all. For example:
33+
The descriptive name (**AddBlogTable**) for the migration is a classname in PHP.
34+
So you must name a valid classname.
35+
36+
The year, month, date, and time in a prefix can be separated from each other by
37+
dashes (``-``), underscores (``_``), or not at all. For example:
3338

3439
* 2012-10-31-100538_AlterBlogTrackViews.php
3540
* 2012_10_31_100539_AlterBlogAddTranslations.php
3641
* 20121031100537_AddBlog.php
3742

43+
Each Migration is run in numeric order forward or backwards depending on the
44+
method taken. This helps prevent numbering conflicts when working in a team
45+
environment.
46+
3847
******************
3948
Create a Migration
4049
******************

0 commit comments

Comments
 (0)