Field note
What it does
Active Record Migrations Migrations are a feature of Active Record that allows you to evolve your database schema over time. Rather than write schema modifications in pure SQL, migrations allow you to use a Ruby Domain Specific Language (DSL) to describe changes to your tables. After reading this guide, you will know: Which generators you can use to create migrations. Which methods Active Record provides to manipulate your database. How to change existing migrations and update your schema. How migrations relate to schema.rb . How to maintain referential integrity. Skip to article body Chapters Migration Overview Generating Migration Files Creating a Standalone Migration Creating a New Table Adding Columns Removing Columns Creating Associations Other Generators that Create Migrations Passing Modifiers Updating Migrations Creating a Table Creating a Join Table Changing Tables Changing Columns Column Modifiers References Foreign Keys Composite Primary Keys Execute SQL Using the change Method Using reversible Using the up / down Methods Throwing an error to prevent reverts Reverting Previous Migrations Running Migrations Rolling Back Setting Up the Database Preparing the Database Resetting the Database Running Specific Migrations Running Migrations in Different Environments Changing the Output of Running Migrations Rails Migration Version Control Changing Existing Migrations Schema Dumping and You What are Schema Files for?
Capabilities
Available capabilities
Tags
Tags
No tags filed yet.
Ways to use it
Ways to use it
No integrations filed yet.