2 years 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
2 years ago
There's no terminal in railway
2 years ago
nor SSH connection
2 years 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
2 years ago
Just be careful with the seeder since it will seed everytime u build
2 years ago
Seems like its Railway related, just try again
2 years ago
No
2 years ago
Only if ur code does that, but Railway Dbs are persistent
2 years ago
run the migrations on the start command
2 years 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"
2 years ago
yes, its the same
i removed the start functions since i dont need them lets see what that does hehe
2 years ago
Do you have a PORT env var?
2 years ago
Then it just wasn't 'there yet'
2 years ago
And I guess this issue didn't happen locally
2 years ago
?
2 years ago
Hmm, I suspect your laravel app is missing some config for prod
2 years ago
But I never used Laravel in my entire life
2 years ago
So I don't think I can help u there