• Reading time ~ 1 min
  • 07.04.2023

This community PlanetScale package for Laravel adds an artisan pscale:migrate command to your Laravel applications. This command helps you manage database migrations using the PlanetScale API, a process which varies slightly from using the built-in migrate command.

During a deployment, you'd run the following command instead of migrate which does everything necessary to update your database's schema:

php artisan pscale:migrate

Why is this needed?

You might wonder why this command is needed instead of directly using the migrate command.

According to the package's readme, PlantScale handles migrations in a different way that you'd typically see with databases:

PlanetScale has alot of advantages when using it as your application's production database. However it handles your database and schema migrations in a somewhat unusual way.

It uses branches for your database. A branch can be production or development...

This package uses PlanetScale's Public API to automate the process of creating a new development branch, connecting your app to the development branch, running your Laravel migrations on the development branch, merging that back into your production branch, and deleting the development branch.

To get started with this package, check out the package setup instructions on GitHub at x7media/laravel-planetscale.

Related:

Speaking of PlanetScale and databases, Aaron Francis published MySQL for Developers. We'd highly recommend you check that out to improve your database skills.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297