From 22cf15ecf3a306917ef18518aee7f0fc13eddb67 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 11:07:39 +0900 Subject: [PATCH 1/3] docs: improve description for Migration File Names --- user_guide_src/source/dbmgmt/migration.rst | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index dec16c5037ff..c0a565381f5a 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -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 ****************** From 71137925dced6e3d3da5849d29481e8e762ca358 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 11:07:50 +0900 Subject: [PATCH 2/3] docs: add link to section --- user_guide_src/source/dbmgmt/migration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index c0a565381f5a..278b6e9ba904 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -58,7 +58,7 @@ The database connection and the database Forge class are both available to you t ``$this->db`` and ``$this->forge``, respectively. Alternatively, you can use a command-line call to generate a skeleton migration file. -See **make:migration** in :ref:`command-line-tools` for more details. +See `make:migration`_ in :ref:`command-line-tools` for more details. .. note:: Since the migration class is a PHP class, the classname must be unique in every migration file. From e53c32cd714a70e301d0084d2c5b864cceb0092b Mon Sep 17 00:00:00 2001 From: kenjis Date: Sun, 8 Sep 2024 17:38:09 +0900 Subject: [PATCH 3/3] docs: fix typo --- user_guide_src/source/dbmgmt/migration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/dbmgmt/migration.rst b/user_guide_src/source/dbmgmt/migration.rst index 278b6e9ba904..5a4bc0852cee 100644 --- a/user_guide_src/source/dbmgmt/migration.rst +++ b/user_guide_src/source/dbmgmt/migration.rst @@ -33,7 +33,7 @@ migration was created, in **YYYY-MM-DD-HHIISS** format. 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 +The year, month, day, 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