2017 © Pedro Peláez
 

library app-migration

Provides a package for adding runtime migrations to an application.

image

dreadlabs/app-migration

Provides a package for adding runtime migrations to an application.

  • Wednesday, October 14, 2015
  • by dreadwarrior
  • Repository
  • 1 Watchers
  • 0 Stars
  • 288 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

AppMigration

Provides an opinionated, ready-to-use way to integrate runtime migration into your PHP application., (*1)

Status

Build Status Coverage Status SensioLabsInsight Code Climate Scrutinizer Code Quality, (*2)

Installation

~ $ php composer.phar require dreadlabs/app-migration:~0.1.1

Components

Interfaces

  • LockInterface - Adapter interface to locking library
  • LoggerInterface - An slimmed down version of the PSR-3 logger interface
  • MediatorInterface - This is the glue between lock, logger and migrator
  • MigratorInterface -Adapter interface to migration library

Exceptions

  • LockingException - If anything goes wrong during locking
  • MigrationException - If a migration can't be executed. Exception code is the version number of the migration which produced the exception.
  • TopologyViolationException - If one or more unprocessed migrations are younger than the latest processed migration.

Companion packages

Opinionated - why?

Topological assumption

I believe, there should be only one direction during migration: "up". This belief comes from looking to migrations like they are ordered on a time axis. You can't go back in time - can you? - and therefore no way to migrate "down"., (*3)

If you have the need to migrate down (e.g. during testing), just create another migration which rolls back the last one. Then decide which migrations to drop and which can go into CVS., (*4)

Logging

Logging is essential during migration. If something went wrong, you need to know as soon as possible what is the problem. Logging is a first class citizen in the mediator. If you don't need logging, just pass in a NullLogger and you're good to go., (*5)

License

MIT, © 2015 Thomas Juhnke, (*6)

The Versions