Continuation of migration plugin


Go to first session : https://sathia27.wordpress.com/2011/07/28/cakephp-migration-plugin/

On every migration you will need to compare schema migration except first migration.

Next you need to genrate schema

cake migration generate
Welcome to CakePHP v1.3.7 Console
---------------------------------------------------------------
App : app
Path: /var/www/workspace/art-and-soul/app
---------------------------------------------------------------
Cake Schema Shell
---------------------------------------------------------------
Generating Schema...
Schema file: schema.php generated

Seewhether both migration are generated in /app/config/migration/200720011_intial_migration and /app/config/schema/schema.php

on every database change both  migrate schema and migration plugin

Once your frieeg get your project from SCM (git, svn)

He will run

cake migration run all

also has many option in migration

cake migration up, down, all or reset
cake migration status
Welcome to CakePHP v1.3.7 Console
---------------------------------------------------------------
App : app
Path: /var/www/workspace/art-and-soul/app
---------------------------------------------------------------
Cake Migration Shell
---------------------------------------------------------------
Application

Current version:
 #001 280720110738_initial_migration
Latest version:
 #001 280720110738_initial_migration
---------------------------------------------------------------
Migrations Plugin

Current version:
 #001 001_init_migrations
Latest version:
 #001 001_init_migrations

you can also use help from shell by

cake migration help
 
Advertisements

About sathia

Web developer at cloudmint
This entry was posted in Web and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s