With our dependencies and configuration files in place, we can now create our database. Using the
yiic
command, create a migration called users and a migration called reminders.
The users migration will create the users
database and ensure that no duplicate e-mail address can be entered at the database level. Within the protected/migrations
folder, open up the users migration:
In the up()
method, add the following:
$this->createTable('users', array( 'id' => 'pk', 'email' => 'string', 'password' => 'string', 'created' => 'integer', 'updated' => 'integer' ));
Note
You may notice that the column types we selected do not match up with MySQL column types. This is because we are allowing Yii to determine the appropriate column type for the database adapter we are using. This allows interoperability between multiple database drivers, meaning that we could seamlessly swap the underlying database...