-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Some questions #2
Comments
Hello, I don't think it is a version problem. It seems to me that this column does not exist or there is no foreign key on users table. |
Yes, I do. In migrations file I have this code:
Last time I even copied your migration code to my project. Nothing changed. In console after migration:
|
Solved! Created table was in MyISAM, changed default storage engine in phpmyadmin Variables to InnoDB and now everything works as expected! |
Hello Zura!
Thanks a lot for your 7 hour tutorial. It really helps!
However I have some issues with it. If you don't mind I will post my questions here in one place as I go through your video.
And the first one is about Gii. Before it everything was smooth and clear.
Time stamp is about here - https://youtu.be/whuIf33v2Ug?t=6658
In your code in rules method you have this line:
[['created_by'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['created_by' => 'id']],
I don't have it, rules end with:
[['video_id'], 'unique'],
attributeLabels() looks fine, just like yours and then my code ends with find() method. I don't have getCreatedBy() method generated.
My first though was about DB, maybe I had some mismatches there, so I've completed migration several times, and followed your gii generation about 3 times, but without any luck, my code is generated differently from yours. I've even copy-pasted your migration code and tried one more time.
My Yii version is 2.0.38, but you've used 2.0.34. Could it be the reason?
The text was updated successfully, but these errors were encountered: