sachoo/phalcon-console-migration

Based on sachoo/phalcon-console, this component handle databases migrations (up, down, diff, status, run)

2.0.1 2020-09-10 15:30 UTC

This package is not auto-updated.

Last update: 2024-04-19 08:31:16 UTC


README

Based on sachoo/phalcon-console, this component handle databases migrations (up, down, diff, status, run) based on your models metadatas.

Requirements

  • PHP >= 5.6
  • Phalcon >= 3.0.0

Installing

Follow the install instructions here sachoo/phalcon-console

Usage

Migrations commands generate scripts with datetime versioning. In your configuration file, you must to define a config->application->migrationDir value. Then you have to manage your model metadatas with sachoo/phalcon-model-annotations

To know more about the power of Migrations, execute:

 ./console mig

This command should display something similar to:

Help:
  Migration Commands

Usage: Generate a Migration
  mig gen

Usage: Run all available Migrations
  mig run

Usage: Run just one migration up
  mig up

Usage: Run just one migration down
  mig down

Usage: Generate migration file with Diff beetween Models and your Databases
  mig diff

Usage: Show migration status
  mig status