Download the PHP package 8ctopus/nano-migrations without Composer
On this page you can find all versions of the php package 8ctopus/nano-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 8ctopus/nano-migrations
More information about 8ctopus/nano-migrations
Files in 8ctopus/nano-migrations
Package nano-migrations
Short Description Automate database migrations
License MIT
Homepage https://github.com/8ctopus/migration
Informations about the package nano-migrations
nano migrations
A tiny database migrations package
Migrations are used to manage database schema changes over time. The rationale behind migrations is to make it easier to maintain and evolve the database schema as the application evolves. This package makes it easy to deal with migrations in small projects not using a framework.
demo
- git clone the repository
- run
composer install
- create the migrations file
touch demo/migrations.txt
- start Docker Desktop and
docker-compose up &
-
to migrate
php demo/index.php migrate [<count:int>]
-
to rollback
php demo/index.php rollback <count:int>
install
composer require 8ctopus/nano-migrations
You will need to extend AbstractPDOMigration
class if you use php PDO
. Extending the class requires implementing the up
and down
migration methods and the potential safety check. Refer to the demo directory example.
For other database engines, extend the AbstractMigration
class and implement:
up
anddown
methods- database connection
- database query
clean code
composer fix(-risky)
phpstan
composer phpstan
phpmd
composer phpmd