Web Development

The Yii Framework offers what is called Database Migrations.

Database Migrations is a term used whenever there are any database changes that occur. This could be any database changes from table creations, additional fields, dropping fields to adding keys.

A common error whenever creating migrations is:

Error: The migration directory does not exist: application.migrations

This commonly occurs whenever we try to use the yiic of the framework folder. Remember the one we used to create the application?

To fix this, we should use the yiic file inside the protected folder:

protected/yiic.php
protected/yiic
protected/yiic.php

Successfully running migration commands should output the following:

php yiic.php migrate create create_deals_table

Yii Migration Tool v1.0 (based on Yii v1.1.15)

Create new migration '/Library/WebServer/Documents/webapplication/protected/migrations/m140810_060412_create_products_table.php'? (yes|no) [no]:yes
New migration created successfully.

Goodluck!