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 145 | Next

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

It has a single
integer column named version that is updated with the number of the migration that was
last run. If migrations are run and this table does not yet exist, the Active Record migration
process we are executing will create it. If you select from the table, you can see that there is
a single row, and the value of the version column is 1.
mysql> select * from schema_info;
+---------+
| version |
+---------+
| 1 |
+---------+
1 row in set (0.00 sec)
Referring to the original migration code, you can see the create_table method takes the
block form endemic to most DSLs. You can pass a few different options to the create_table
method itself to change the way the table works. You can specify the name of the primary key
column with the :primary_key option. You can turn off a default primary key completely by
adding :id => false; this is most useful when you??™re creating a join table for HABTM relationships,
which don??™t typically have a normal id column. Supplying :temporary => true will
create a temporary table.


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