a year ago
Hello everyone so im hosting a laravel rest api but i cant seem to access the terminal and run cmds to seed the database etc, i want to seed the database on every start up
0 Replies
a year ago
There's no terminal in railway
a year ago
nor SSH connection
a year ago
Yep, add migration command to the start command
but now im getting this issue and i dont seem to quite understand why it is doing it
a year ago
Just be careful with the seeder since it will seed everytime u build
a year ago
Seems like its Railway related, just try again
a year ago
No
a year ago
Only if ur code does that, but Railway Dbs are persistent
a year ago
run the migrations on the start command
a year ago
eg:run migration && run start
[build]
builder = "NIXPACKS"
[build]
buildCommand = "php artisan serve"
[deploy]
startCommand = "php artisan migrate && php artisan db:seed --class=TruckSeeder"
a year ago
yes, its the same
i removed the start functions since i dont need them lets see what that does hehe
a year ago
Do you have a PORT env var?
a year ago
Then it just wasn't 'there yet'
a year ago
And I guess this issue didn't happen locally
a year ago
?
a year ago
Hmm, I suspect your laravel app is missing some config for prod
a year ago
But I never used Laravel in my entire life
a year ago
So I don't think I can help u there