As SQLite is getting traction, move database.sqlite to storage folder #54017
Unanswered
RiadhKHEDHIRI
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Community,
I was playing around with Laravel, SQLite, Forge, and Envoyer.
I noticed that the database gets wiped when deploying because it is not in special folders such as
storage
.The workaround I found is to alter
config/database.php
from'database' => env('DB_DATABASE', database_path('db/database.sqlite')),
to'database' => env('DB_DATABASE', storage_path('db/database.sqlite')),
as we cannot specify a relative path in the.env
file.I thought of something like this
storage/database/{{APP_ENV}}/database.sqlite
.I don't know if this is a long-term solution.
As SQLite is getting traction via Turso, the default RoR setup switched to it to make launching easier, faster, and cheaper by avoiding PaaS. Thus, having the same thing in the Laravel Community would be nice.
What do you think? Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions