You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use `-f` to wipe the database, `-s` to seed after migration, and `--force` to run migrations in production.
75
76
77
+
## Migration Order
78
+
79
+
You can specify the order to run your model migrations by adding a public `migrationOrder` property to your models. This is useful for pivot tables or situations where you must create a certain table before another.
80
+
81
+
```php
82
+
class MyModel extends Model
83
+
{
84
+
public $migrationOrder = 1;
85
+
86
+
public function migration(Blueprint $table)
87
+
{
88
+
$table->id();
89
+
$table->string('name');
90
+
$table->timestamp('created_at')->nullable();
91
+
$table->timestamp('updated_at')->nullable();
92
+
}
93
+
}
94
+
```
95
+
96
+
The `migrate:auto` command will run the automatic migrations in the order specified. If no order is declared for a model, it will default to `0`. Thanks to [@vincentkedison](https://github.com/vincentkedison) for this idea.
97
+
76
98
## Publishing Stubs
77
99
78
100
Use your own model and factory stubs by publishing package files:
0 commit comments