Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ public function up(): void
Sometimes a migration might be meant to support a feature that is not yet active and you do not want it to run yet. In this case you may define a `shouldRun` method on the migration. If the `shouldRun` method returns `false`, the migration will be skipped:

```php
use App\Models\Flights;
use App\Models\Flight;
use Laravel\Pennant\Feature;

/**
* Determine if this migration should run.
*/
public function shouldRun(): bool
{
return Feature::active(Flights::class);
return Feature::active(Flight::class);
}
```

Expand All @@ -173,6 +173,7 @@ If you would like to see the SQL statements that will be executed by the migrati
php artisan migrate --pretend
```

<a name="isolating-migration-execution"></a>
#### Isolating Migration Execution

If you are deploying your application across multiple servers and running migrations as part of your deployment process, you likely do not want two servers attempting to migrate the database at the same time. To avoid this, you may use the `isolated` option when invoking the `migrate` command.
Expand Down