2017 © Pedro Peláez
 

library pgup

PHP PostgreSQL database migration tool

image

davidburger/pgup

PHP PostgreSQL database migration tool

  • Wednesday, June 29, 2016
  • by davidburger
  • Repository
  • 1 Watchers
  • 0 Stars
  • 140 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

Simple PHP Postgres database migration tool


Useful for synchronization of database changes within development team., (*1)

Installation

composer require davidburger/pgup

Prerequisities

  • psql client must be installed
# debian/ubuntu: 
sudo apt-get install postgresql-client
  • PDO_PGSQL driver is required for sync_mode = 'database'

Setup

  • if <project_root>/migrations folder does not exist, it will be created with initial config file
cd <project_root>
./vendor/bin/pgup
  • edit database credentials in <project_root>/migrations/config/global.php

Basic principles

  • password for individual hosts are stored in ~.pgpass - see http://www.postgresql.org/docs/9.5/interactive/libpq-pgpass.html
  • if ~/.pgpass does not exist, it is created automatically
  • sql files could be successfully processed only once for given environment - they are checked for their equivalent stored in "applied" folder (sync_mode = filesystem) or in the database table "migration" (sync_mode = database)
  • output is written to the path defined by 'log_dir' configuration variable

Usage

  • create empty sql migration file from template:
php vendor/bin/pgup create --comment="add_new_table"
  • process migration files:
php vendor/bin/pgup
  • process migration files for specific environment:
php vendor/bin/pgup --env=development

The Versions

29/06 2016

dev-master

9999999-dev https://github.com/davidburger/pgup

PHP PostgreSQL database migration tool

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.3

 

by David Burger

database postgresql postgres migration

29/06 2016

v1.2

1.2.0.0 https://github.com/davidburger/pgup

PHP PostgreSQL database migration tool

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.3

 

by David Burger

database postgresql postgres migration

14/06 2016

v1.1

1.1.0.0 https://github.com/davidburger/pgup

PHP PostgreSQL database migration tool

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.3

 

by David Burger

database postgresql postgres migration

23/05 2016

v1.0

1.0.0.0 https://github.com/davidburger/pgup

PHP PostgreSQL database migration tool

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.3

 

by David Burger

database postgresql postgres migration