Skip to content

Introduction

What Phalcon Migrations is, what it needs, and how to install it.

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_pgsql or pdo_sqlite
  • The yaml extension, only if you use a YAML configuration file
  • The posix extension (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/migrations

Using 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 list

The PHAR accepts the same arguments and options as vendor/bin/phalcon-migrations.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close