SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 149 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"


?– Note Once you??™ve committed a migration file, you need to assume that someone else on your project has
obtained the file and run it. This means that you cannot make changes to that file, since the migrator will
assume that the file has already been run and completely ignore your changes, making the database inconsistent
with the code. It??™s completely acceptable to have a lot of little migration files that make small changes,
because it keeps everyone working together and unconfused. Migration errors and consistency problems are
some of the most annoying to clean up.
Since we need to add the farmer_id column to the table, we create another migration with
script/generate migration add_farmer_id_column. This command will make the file db/migrate/
002_add_farmer_id_column.
To add a single column, we use the add_column method, as we described previously. It works
just the same as the column method in create_table??™s block form, only now you must supply
the name of the table you??™re working on:
CHAPTER 3 ?–  SETTING UP YOUR DATABASE 53
def self.


Pages:
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6