Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to `jonaspauleta/scout-postgres` are documented here.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.1] - 2026-08-07

### Changed

- Allow calling `ignoreMigrations()` on the service provider to not automatically run.

## [2.0.0] - 2026-07-09

### Changed
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ Run migrations — the package migration is auto-loaded and creates the `pg_trgm
php artisan migrate
```

Publishing migrations (to run your own, you can call `ScoutPostgres\ScoutPostgresServiceProvider::ignoreMigrations()` in a boot method):

```bash
php artisan vendor:publish --tag=scout-postgres-migrations
```

## Configuration

Set Scout to use the `pgsql` engine in your `.env`:
Expand Down
14 changes: 12 additions & 2 deletions src/ScoutPostgresServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@

final class ScoutPostgresServiceProvider extends PackageServiceProvider
{
private static bool $runsMigrations = true;

public function configurePackage(Package $package): void
{
$package
->name('scout-postgres')
->hasConfigFile('scout-postgres')
->hasMigration('0000_01_01_000000_create_postgres_search_extensions')
->runsMigrations();
->hasMigration('0000_01_01_000000_create_postgres_search_extensions');

if (self::$runsMigrations) {
$package->runsMigrations();
}
}

public function packageBooted(): void
Expand All @@ -31,4 +36,9 @@ public function packageBooted(): void
$manager->extend('pgsql', fn () => $app->make(PostgresEngine::class));
});
}

public static function ignoreMigrations(): void
{
self::$runsMigrations = false;
}
}