Managing databases within Laravel Vapor.
database
CLI command. When using the CLI command, the command will prompt you for more details about the database such as its desired performance class and maximum storage space.
--dev
flag when creating your database. These small, affordable databases are perfect for testing or staging environments:
database
key to the environment’s configuration in your vapor.yml
file and deploy your application. The value of this key should be the name of the database. When the environment is deployed, Vapor will automatically inject the necessary Laravel environment variables for connecting to the database, allowing your application to start using it immediately:
database:shell
CLI command. Jumpboxes are very small, SSH accessible servers that are placed within your private network.
database:shell
command to quickly access a command line database shell that lets you interact with your database:
database:proxy
CLI command:
database-proxy
configuration option within your vapor.yml
file:
database:delete-proxy
CLI command. Before deleting a proxy, make sure none of your applications are using the associated proxy:
database:user
CLI command:
database-user
configuration option within your vapor.yml
file:
database:password
CLI command to rotate the password of a database. Alternatively, you may leverage users to “rotate” the password of a database without downtime by creating a new user, updating the environment to use that user, deploying the environment, and then deleting the old database user.database:scale
CLI command. When scaling a fixed size database, the database will be unavailable, and the amount of time it takes to scale the database could vary based on the size of the database. Therefore, you should place your application in maintenance mode before beginning the scaling operation:
database:restore
CLI command:
database
key in your vapor.yml
file and deploy the environment.
Once you are satisfied with the database restoration, you may delete the old database.
database:upgrade
CLI command. When upgrading a database, a new database is created with the same configuration and credentials as the original database:
database:metrics
CLI command:
database:delete
CLI command. Once a database has been deleted, it can not be recovered, so take extra caution before deleting a database: