Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AR models: plugin imports columns/attributes from table in service DB mysql #284

Open
WinterSilence opened this issue May 30, 2022 · 0 comments

Comments

@WinterSilence
Copy link

What steps will reproduce the problem?

  1. create user table in database defined in db component:
CREATE TABLE `user` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`login` VARCHAR(100) NOT NULL,
`password_hash` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `login` (`login`) USING BTREE,
) COLLATE='utf8mb4_unicode_ci' ENGINE=InnoDB;

2 Create model

<?php
namespace app\models;
use yii\db\ActiveRecord;
/**
 * User model.
 *
 * @property int $id
 * @property string $login
 * @property string $password_hash
 */
class User extends ActiveRecord
{
    public static function tableName()
    {
        return '{{user}}';
    }
}

What is the expected result?

No missed columns/attributes - they declared as @property.

What do you get instead?

Plugin generate "missed attributes" error and try to import attributes from table with same name, but in mysql(not db database).
Plugin add @property tags:

Host
User
Select_priv
<...>

Additional info

Q A
IDE Name PhpStorm
IDE Version 2022.2
Plugin version 0.10.58.37
Yii App Template basic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant