Skip to content

Commit ae4ff9a

Browse files
committed
Improve Databases
1 parent 712b7ea commit ae4ff9a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

resources/views/docs/1/digging-deeper/databases.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,27 @@ You do not need to do anything special to configure your application to use SQLi
3838
## Development
3939

4040
Remember that in [development](/docs/getting-started/development) your application's database is always going to be
41-
the SQLite database created in the `appdata` folder for your application.
41+
the SQLite database created in the [`appdata`](/docs/getting-started/debugging#appdata) folder for your application.
4242

4343
This means that even if you've got different config in your `.env` file, your application will not be connecting to any
4444
other database when it is running within the Electron/Tauri environment.
4545

4646
## Migrations
4747

48-
When writing migrations, you need to consider any special recommendations for working with SQLite. For example,
49-
SQLite disables foreign key constraints by default. If your application relies upon foreign key constraints,
50-
[you need to enable SQLite support for them](https://laravel.com/docs/database#configuration) before
51-
writing your migrations.
48+
When writing migrations, you need to consider any special recommendations for working with SQLite.
5249

53-
**It's important to test your migrations before releasing updates!** You don't want to accidentally delete your user's
54-
data when they update your app.
50+
For example, prior to Laravel 11, SQLite foreign key constraints are turned off by default. If your application relies
51+
upon foreign key constraints, [you need to enable SQLite support for them](https://laravel.com/docs/database#configuration) before running your migrations.
52+
53+
**It's important to test your migrations on prod builds before releasing updates!** You don't want to accidentally
54+
delete your user's data when they update your app.
5555

5656
### Running migrations
5757

5858
NativePHP will attempt to migrate your database on each boot-up.
5959

60-
You may also wish to manually migrate it during development, either while the application is already running or without
61-
booting the application.
60+
You may also wish to manually migrate it during development. You can do this whether the application is running or not,
61+
but depending on how your app behaves, it may be better to do it before opening the app.
6262

6363
You can do this with the `native:migrate` command:
6464

@@ -74,7 +74,7 @@ used here.
7474
You can completely refresh your app database using the `native:migrate fresh` command:
7575

7676
```shell
77-
php artisan native:migrate fresh
77+
php artisan native:migrate:fresh
7878
```
7979

8080
**This is a destructive action that will delete all data in your database.**

0 commit comments

Comments
 (0)