CREATE
TABLE
Employee ( id
MEDIUMINT UNSIGNED NOT
NULL
AUTO_INCREMENT PRIMARY
KEY , departmentId
TINYINT UNSIGNED NOT
NULL COMMENT
"CONSTRAINT
FOREIGN KEY (departmentId) REFERENCES Department(id)" , firstName
VARCHAR (20)
NOT
NULL , lastName
VARCHAR (40)
NOT
NULL , email
VARCHAR (60)
NOT
NULL , ext
SMALLINT
UNSIGNED NULL , hireDate
TIMESTAMP
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP , leaveDate
DATETIME NULL , INDEX
name
(lastName, firstName), INDEX
(departmentId) ) |
use
Gii to create the fundamental Model, View, and Controller files required by the application
Next, under the modules section of the returned array, you should enable Gii. Gii is a Web-based tool that you’ll use to generate Models, Views, and Controllers for the application. To enable Gii, just remove the comment tags—/* and */—that surround this code:
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'SECURE',
),
- Because Gii is a powerful tool, it’s best not to enable it on a live server. Ideally you’ll enable Gii on a development server, use it, and disable it, and then later put the site online.