Ruby on Rails-like database-independent migration syntax and console management
PHP Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


 Ruby on Rails-like database migration management for PHP
 some (c) 2009/2010
 free to share, remix, use in commercial projects, with ot without attribution
 as long as the source is treated AS-IS without expecting any specific support ;)
 Source provided AS-IS and subject to changes, it's advised to test migrations on a temporary database for now.
 The main aim of this project is to provide PHP developers with means of creating
 non-SQL based migrations and tools to maintain database changes between developers/
 different project servers/sandboxes and database adaptors.
 Whilst there already exist classes and tools for maintaining migrations in PHP,
 very few of them can generate SQL changes through php functions (or do so through
 awfully long class/function names). It was my aim to port most of the syntax and
 functionality from RoR, being the main pioneer of migration-based approach. 

 A migration is a description of changes made to the database [provided in 
 the up() method] and means to revert them [provided in the down() method].
 Migrations allow to automate the tedious process of maintaining the current 
 state of the database between developers/database interfaces, keep track of changes
 made (with means to undo them if required), make experimenting easy.
    * generic helper functions for database independent SQL generation
      (e.g. create_table, t_[basic type] for columns etc.; see db methods)
    * command-line management
    * timestamp-based migration file naming: avoid conflicts between developers
    * transaction-based migration execution: prevent erroneous changes to succeed
    * migration version is stored in a file, which allows easy transfer of migration setup
      (note: you should exclude/ignore schema.php from sandbox repositories)
    * open-ended and flexible: provides means to allow for different database adapters,
      convenient ways to specify function parameters (NB: adaptor implementations are welcome)
 rename/copy config.sample.php to config.php and modify it as prompted in comments
 to get started, launch a console in the directory containing migrate.php and launch:
  php -f migrate.php help
 or use the provided convenience shell script
  db help
 If wanting to share with another developer, you should ignore schema/ folder or schema.php directly.
 Have a look at some documentation: