Skip to content

Commit 35c685b

Browse files
authored
Merge branch 'main' into main
2 parents 800a561 + 6c3da1b commit 35c685b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

README.md

+12-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
------
1212

13-
> This package is a work-in-progress, and the goal is to keep improving the migration stub: [database/migrations/optimize_database_settings.php.stub](https://github.com/nunomaduro/laravel-optimize-database/blob/main/database/migrations/optimize_database_settings.php.stub).
13+
> This package is a work-in-progress, and the goal is to keep improving the migration stub: [database/migrations/optimize_database_settings.php.stub](https://github.com/nunomaduro/laravel-optimize-database/blob/main/database/migrations/optimize_database_settings.php.stub). At the moment, it only supports SQLite, but I am open to adding support for other database types.
1414
1515
This package publish a migration that will apply good defaults to your SQLite database, making it faster and more production-ready.
1616

@@ -35,13 +35,17 @@ php artisan db:optimize
3535
This will publish a migration that apply defaults like so:
3636

3737
```SQL
38-
PRAGMA journal_mode = WAL;
39-
PRAGMA synchronous = NORMAL;
40-
PRAGMA page_size = 32768;
41-
PRAGMA cache_size = -20000;
42-
PRAGMA auto_vacuum = incremental;
43-
PRAGMA foreign_keys = ON;
44-
// etc...
38+
public function up(): void
39+
{
40+
DB::statement('PRAGMA journal_mode = WAL');
41+
DB::statement('PRAGMA synchronous = NORMAL');
42+
DB::statement('PRAGMA page_size = 32768;');
43+
DB::statement('PRAGMA cache_size = -20000;');
44+
DB::statement('PRAGMA auto_vacuum = incremental;');
45+
DB::statement('PRAGMA foreign_keys = ON;');
46+
47+
// etc...
48+
}
4549
```
4650

4751
Next, you simply need to run the migration:

0 commit comments

Comments
 (0)