Migrating a Database in a Rails Project

Use one of the following methods to migrate to a database in a Rails Project.

To migrate using the Rails Console:

  1. Open the Rails Console and run:
    rake db:migrate
  2. Check the console to see the migration is completed without error.

To migrate using the Model Creation Wizard:

  1. Rails Model Wizard New Rails Project Wizard
    From the workbench select: File| New| Rails Model.
  2. Add the desired attributes in the Model Creation Wizard dialog.
  3. Check the Run the Migration after creating the Model checkbox.

    Note:

    These steps require that the database is set up and the database.yml file is properly configured.

Tp run a migration from an Explorer:

  1. Right-click on the project folder from the Rails or Script Explorer.
  2. Select Rails| Database Migration.

To reverse a migration:

  1. Reverse a database migration using the Project Commander and the following command:
    rake migrate VERSION {ver. #}
Related Tasks Creating a Database Creating a Model
Corporate LogoCodeGear brand and product names are service marks, trademarks or registered trademarks of Borland Software Corporation in the United States and other countries.