Type: Database Configuration & Migration Package Purpose: Provides database configuration and migration for MultiFlexi components (executor, scheduler, API, and web) Status: Active Repository: https://github.com/VitexSoftware/multiflexi-database
- Database Migration Tools
- Database Agnostic
- Using PHP Phinx migrations https://phinx.org/
- Support for Multiple Database Engines:
- MySQL
- PostgreSQL
- SQLite
- MariaDB
- MSSQL (experimental)
- Debian Packaging
multiflexi-database/
├── db/migrations/ # Database migration files
├── debian/ # Debian packaging files
├── config/ # Database configuration templates
└── scripts/ # Migration and setup scripts
- Supported database engine (MySQL, PostgreSQL, SQLite, MariaDB, or MSSQL)
- Debian/Ubuntu system for package installation
# Add VitexSoftware repository
sudo apt install lsb-release wget apt-transport-https bzip2
wget -qO- https://repo.vitexsoftware.com/keyring.gpg | sudo tee /etc/apt/trusted.gpg.d/vitexsoftware.gpg
echo "deb [signed-by=/etc/apt/trusted.gpg.d/vitexsoftware.gpg] https://repo.vitexsoftware.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/vitexsoftware.list
sudo apt update
# Install for your database type (replace DBTYPE with mysql, pgsql, or sqlite)
sudo apt install multiflexi-DBTYPE# Skip automatic migration during installation (useful for Docker)
sudo MULTIFLEXI_NOMIGRATE=1 apt install multiflexi-sqlite
# Run migrations manually
multiflexi-migrator- Database Migrations: Versioned schema changes for MultiFlexi database
- Multi-Engine Support: Single codebase supporting multiple database backends
- Package Variants: Separate Debian packages for each database type
- Automatic Migration: Migrations run during package install/upgrade by default
sudo apt install multiflexi-mysqlsudo apt install multiflexi-pgsqlsudo apt install multiflexi-sqlite# Set environment variable before installation
export MULTIFLEXI_NOMIGRATE=1
sudo -E apt install multiflexi-mysql- MultiFlexi Web: Main web interface
- MultiFlexi Executor: Job execution engine
- MultiFlexi Scheduler: Job scheduling component
- MultiFlexi API Server: REST API service
- Target Environment: Debian/Ubuntu servers
- Distribution: Via VitexSoftware APT repository
- Docker Support: Use MULTIFLEXI_NOMIGRATE=1 for image builds
CRITICAL: When creating foreign key relationships, ensure column types match exactly between tables, especially for MySQL unsigned integers.
// For MySQL compatibility, always check database type and use unsigned integers when referencing user.id
$databaseType = $this->getAdapter()->getOption('adapter');
$unsigned = ($databaseType === 'mysql') ? ['signed' => false] : [];
// Use array_merge to apply unsigned attribute when referencing user table
->addColumn('user_id', 'integer', array_merge(['null' => false], $unsigned))Why: The user.id field is int(11) unsigned in MySQL. Foreign key columns must have identical types or constraint creation will fail with "errno: 150 Foreign key constraint is incorrectly formed".
# Always use the phinx-adapter.php configuration
vendor/bin/phinx migrate -c phinx-adapter.php- Migration Failures: Check database permissions and connectivity
- Foreign Key Constraint Errors: Verify column types match exactly between referenced tables
- Package Conflicts: Ensure only one multiflexi-DBTYPE package is installed
- Connection Issues: Verify database credentials in configuration
- MultiFlexi (main project)
- multiflexi-executor
- multiflexi-scheduler
- multiflexi-server
- multiflexi-cli
- Part of the MultiFlexi suite for business automation
- Migrations are idempotent and can be run multiple times safely
- Database choice impacts performance and scalability characteristics