Package git repository
https://github.com/phalcon/migrations
Requirements
- PHP >= 8.2
- The PDO extension and the PDO driver for your database:
pdo_mysql,pdo_pgsqlorpdo_sqlite - The
yamlextension, only if you use a YAML configuration file - The
posixextension (optional, Linux and macOS). Without it, the output has no colors.
Supported databases
| Database | adapter value |
Notes |
|---|---|---|
| MySQL | mysql |
Default port: 3306. The connection uses the charset value of the configuration. Default: utf8mb4. |
| PostgreSQL | postgresql |
Default port: 5432. Default schema: public. |
| SQLite | sqlite |
The dbname value is the path to the database file. |
The adapter value is not case-sensitive. The PDO name pgsql is an alias of postgresql.
For SQLite, the dbname value :memory: gives a database in memory, for example for the tests of an application. run uses one connection for the migrations and the database log, so the tables and the log are in the same database. After Migrations::run(), Phalcon\Migrations\Mvc\Model\Migration::getAdapter() returns the adapter of that connection. The database is lost when the connection closes.
Installing via Composer
composer require --dev phalcon/migrationsUsing the PHAR
Each release on GitHub has a phalcon-migrations.phar file. Download it from the releases page. Run it with PHP:
php phalcon-migrations.phar listThe PHAR accepts the same arguments and options as vendor/bin/phalcon-migrations.