Skip to content

Commit

Permalink
docs: improve description for Migration File Names
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Sep 8, 2024
1 parent 0a6b39d commit 22cf15e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions user_guide_src/source/dbmgmt/migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,28 @@ include migrations from all namespaces.
Migration File Names
********************

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

* 2024-09-08-013653_AddBlogTable.php

Each migration is numbered using the timestamp (**2024-09-08-013653**) when the
migration was created, in **YYYY-MM-DD-HHIISS** format.

Prefix your migration files with the migration number followed by an underscore
and a descriptive name for the migration. The year, month, and date can be separated
from each other by dashes, underscores, or not at all. For example:
The descriptive name (**AddBlogTable**) for the migration is a classname in PHP.
So you must name a valid classname.

The year, month, date, and time in a prefix can be separated from each other by
dashes (``-``), underscores (``_``), or not at all. For example:

* 2012-10-31-100538_AlterBlogTrackViews.php
* 2012_10_31_100539_AlterBlogAddTranslations.php
* 20121031100537_AddBlog.php

Each Migration is run in numeric order forward or backwards depending on the
method taken. This helps prevent numbering conflicts when working in a team
environment.

******************
Create a Migration
******************
Expand Down

0 comments on commit 22cf15e

Please sign in to comment.