formal / migrations
SQL and Commands migrations
1.0.0
2024-10-04 18:12 UTC
Requires
- php: ~8.2
- formal/orm: ~3.4
- innmind/operating-system: ~5.2
Requires (Dev)
- innmind/black-box: ~5.7
- innmind/coding-standard: ~2.0
- vimeo/psalm: ~5.13
This package is auto-updated.
Last update: 2024-11-04 18:30:27 UTC
README
This library is a simple one way migration system.
You can run both SQL and Commands migrations.
Installation
composer require formal/migrations
Usage
use Formal\Migrations\Factory; use Innmind\OperatingSystem\Factory as OS; use Innmind\Url\{ Url, Path, }; $dsn = Url::of('mysql://user:pwd@127.0.0.1:3306/database'); Factory::of(OS::build()) ->storeVersionsInDatabase($dsn) ->sql() ->files(Path::of('migrations/folder/')) ->migrate($dsn) ->match( static fn() => print('Everything has been migrated'), static fn(\Throwable $error) => printf( 'Migrations failed with the message : %s', $error->getMessage(), ), );
Documentation
Full documentation available here.