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

Kevin Marshall, Chad Pytel, and Jon Yurek

"Pro Active Record: Databases with Ruby and Rails"

Here??™s how to check
on that:
mysql> show tables;
Empty set (0.12 sec)
The migration code is run when you run rake db:migrate, resulting in the cows table
being created with the following columns:
mysql> describe cows;
+----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(255) | YES | | NULL | |
| breed | varchar(255) | YES | | NULL | |
| born_on | datetime | YES | | NULL | |
| milkable | tinyint(1) | YES | | NULL | |
+----------+--------------+------+-----+---------+----------------+
CHAPTER 3 ?–  SETTING UP YOUR DATABASE 51
Additionally, if you now list the tables in your database, you can see that not only has the
cows table been created but an additional table as well:
mysql> show tables;
+-----------------------------+
| Tables_in_test2_development |
+-----------------------------+
| cows |
| schema_info |
+-----------------------------+
The schema_info table is a table used internally by the Active Record migrator.


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