github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

joelmoss / cakephp-db-migrations

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 61
    • 12
  • Source
  • Commits
  • Network (12)
  • Issues (0)
  • Downloads (1)
  • Wiki (7)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • gh-pages
    • master ✓
  • Tags (1)
    • 4.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Database migrations shell for CakePHP. NO LONGER MAINTAINED HERE. MOVED TO http://codaset.com/joelmoss/cakephp-db-migrations — Read more

  cancel

http://codaset.com/joelmoss/cakephp-db-migrations

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Removed Spyc and references to it from Migrate shell. Now uses Yaml class Comment
joelmoss (author)
Sat Dec 27 12:48:52 -0800 2008
commit  5f785c6d25ce63018fb462c7757e1963867b3954
tree    a15d4776aaab0a6a071e7c67971fd7264874c684
parent  e73453fbed9a28a82de5a9335518e8ddc7244440
cakephp-db-migrations /
name age
history
message
file CHANGELOG Tue Oct 07 12:36:05 -0700 2008 Added support for table prefixes in DB config. ... [joelmoss]
file INSTALL Thu Nov 13 01:09:13 -0800 2008 Updated readme and install files with new way o... [joelmoss]
file README.md Thu Nov 13 01:09:13 -0800 2008 Updated readme and install files with new way o... [joelmoss]
file USAGE Tue May 20 06:56:05 -0700 2008 First beta release of Migrations v4.0 [joelmoss]
directory vendors/ Sat Dec 27 12:48:52 -0800 2008 Removed Spyc and references to it from Migrate ... [joelmoss]
README.md

CAKEPHP DATABASE MIGRATIONS

NOTE To download the latest stable release, you should use the latest tag: http://github.com/joelmoss/cakephp-db-migrations/downloads/4.0

Database Migrations for CakePHP 1.2 is a shell script supported by the CakePHP console, that lets you manage your database schema without touching one little bit of SQL. It is based on the Ruby on Rails implementation of Migrations, and uses Pear's MDB2 package, so supports all the databases that that supports.

You could think of Migrations as a version control system for your database. It's power lends itself perfectly to developing as part of a team, as each member can keep their own independent copy of their application's database, and use Migrations to make changes to its schema. All other members have to do then, is to run a simple two word shell command, and their database copy is up to date with everyone else's.

The Migrations shell will generate a migration file for each DB change you want to make. This file can include any number of DB changes.

The Migration files support YAML and PHP array's. So instead of having to write SQL queries, you can write a short YAML structure that will do the same thing:

create_table:
  users:
    name: string
    age: int
    is_active: bool

or the equivalent in a PHP array:

array(
  'create_table' => array(
    'users' => array(
      'name' => array(
        'type' => 'string'
      )
      'age' => array(
        'type' => 'int'
      )
      'is_active' => array(
        'type' => 'bool'
      )
    )
  )
)

The above YAML code will create a table called 'users'. This is equivalent to running the following MySQL code:

CREATE TABLE users (
  id int(11) NOT NULL auto_increment,
  name varchar(255) default NULL,
  age int(11) default NULL,
  is_active tinyint(1) default NULL,
  created datetime default NULL,
  modified datetime default NULL,
  PRIMARY KEY  (id)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

This package also includes an extremely easy to use Fixtures shell that works seamlessly with Migrations. Fixtures also use YAML and are a great way to insert test and/or development data into your database.

Please check out the examples directory within this package.

Updates, new releases and other resources can be found at http://code.google.com/p/cakephp-migrations/ For further assistance and additional resources, please check out my Blog at http://developingwithstyle.com

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server