O'Reilly logo

Yii Rapid Application Development Hotshot by James R. Hamilton III, Lauren J. O'Meara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a Migration Script

The migration script will make any database changes that our module requires. Since our module depends on the existence of two tables, we will write a migration script to create them.

Engage Thrusters

  1. To create a new migration, change to the project directory. Run Yiic with the migrate command, specifying the path alias to the module migrations directory.
    cd ~/projects/ch8/protected
    php yiic.php migrate create create_tables_job_queue --migrationPath=application.modules.jobQueue.migrations
    

    The command will output a file named something like this:

    m120927_012345_create_tables_job_queue.php
    

    The filename is the letter m, followed by the UTC timestamp of the time the file is created, followed by the name you gave the command. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required