1. Go to this page and download the library: Download meritum/migrations library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
meritum / migrations example snippets
use Georgeff\Schema\Blueprint;
use Meritum\Migrations\SchemaInterface;
use Meritum\Migrations\MigrationInterface;
return new class implements MigrationInterface {
public function up(SchemaInterface $schema): void
{
$schema->create('users', function (Blueprint $blueprint) {
$blueprint->uuid()->unique()->primary();
$blueprint->string('name');
$blueprint->string('email')->unique();
$blueprint->timestamps();
});
}
public function down(SchemaInterface $schema): void
{
$schema->dropIfExists('users');
}
};
use Meritum\Migrations\Factory\KernelBuilder;
$kernel = KernelBuilder::build(environment: 'production');
$kernel->boot();
$kernel->run();
use Georgeff\Kernel\ServiceRegistrar;
use Meritum\Migrations\Factory\KernelBuilder;
$registrar = new ServiceRegistrar();
$registrar->register(new MyCustomModule());
$kernel = KernelBuilder::build(registrar: $registrar);
$kernel->boot();
$kernel->run();