@@ -22,19 +22,28 @@ include migrations from all namespaces.
22
22
Migration File Names
23
23
********************
24
24
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.
29
32
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, day, and time in a prefix can be separated from each other by
37
+ dashes (``- ``), underscores (``_ ``), or not at all. For example:
33
38
34
39
* 2012-10-31-100538_AlterBlogTrackViews.php
35
40
* 2012_10_31_100539_AlterBlogAddTranslations.php
36
41
* 20121031100537_AddBlog.php
37
42
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
+
38
47
******************
39
48
Create a Migration
40
49
******************
@@ -49,7 +58,7 @@ The database connection and the database Forge class are both available to you t
49
58
``$this->db `` and ``$this->forge ``, respectively.
50
59
51
60
Alternatively, you can use a command-line call to generate a skeleton migration file.
52
- See ** make:migration ** in :ref: `command-line-tools ` for more details.
61
+ See ` make:migration `_ in :ref: `command-line-tools ` for more details.
53
62
54
63
.. note :: Since the migration class is a PHP class, the classname must be unique in every migration file.
55
64
0 commit comments