title: How to create relations automaticly in Yii?
body: <p>Is there a way to create relations automatically?</p>
  
  <pre><code>CREATE TABLE `user` (`id` BIGINT AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB;
  
  
  CREATE TABLE `profile` (`id` BIGINT AUTO_INCREMENT, `user_id` BIGINT, `photo` VARCHAR(255), INDEX `user_id_idx` (`user_id`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = INNODB;
  
  
  ALTER TABLE `profile` ADD CONSTRAINT `profile_user_id_user_id` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE CASCADE;
  </code></pre>
  
  <p>When I generate model via gii, it does not Build Relations.</p>