feat: M2 database migration runner with Phinx and initial schema

This commit is contained in:
Keith Solomon committed 2026-10-11 18:05:23 -05:00
1 parent d3e8cf8fae
commit 93d991703c
20 files changed
+2000 -14

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
use Phinx\Config\Config;
/**
* Phinx configuration for MeshVault database migrations.
*
* Uses environment variables from the application configuration (AppConfig)
* for database connection. Migrations are stored in db/migrations/.
*/
// Load environment from getenv() - Compose injects these into the container
$dbHost = getenv('MESHVAULT_DB_HOST') ?: 'db';
$dbPort = (int) (getenv('MESHVAULT_DB_PORT') ?: 5432);
$dbName = getenv('MESHVAULT_DB_NAME') ?: 'meshvault';
$dbUser = getenv('MESHVAULT_DB_USER') ?: 'meshvault';
$dbPass = getenv('MESHVAULT_DB_PASSWORD') ?: '';
return [
'paths' => [
'migrations' => 'db/migrations',
'seeds' => 'db/seeds',
],
'environments' => [
'default_migration_table' => 'phinxlog',
'default_database' => 'development',
'development' => [
'adapter' => 'pgsql',
'host' => $dbHost,
'port' => $dbPort,
'name' => $dbName,
'user' => $dbUser,
'pass' => $dbPass,
'charset' => 'utf8',
],
],
'version_order' => 'creation',
'migration_base_class' => 'Phinx\Migration\AbstractMigration',
];