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
Copy file name to clipboardExpand all lines: resources/views/docs/1/digging-deeper/databases.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,27 +38,27 @@ You do not need to do anything special to configure your application to use SQLi
38
38
## Development
39
39
40
40
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.
42
42
43
43
This means that even if you've got different config in your `.env` file, your application will not be connecting to any
44
44
other database when it is running within the Electron/Tauri environment.
45
45
46
46
## Migrations
47
47
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.
52
49
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.
55
55
56
56
### Running migrations
57
57
58
58
NativePHP will attempt to migrate your database on each boot-up.
59
59
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.
62
62
63
63
You can do this with the `native:migrate` command:
64
64
@@ -74,7 +74,7 @@ used here.
74
74
You can completely refresh your app database using the `native:migrate fresh` command:
75
75
76
76
```shell
77
-
php artisan native:migratefresh
77
+
php artisan native:migrate:fresh
78
78
```
79
79
80
80
**This is a destructive action that will delete all data in your database.**
0 commit comments