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

can models property comment give database default field value, and auto generate field name const? #693

Open
kavent opened this issue Aug 28, 2018 · 1 comment

Comments

@kavent
Copy link

kavent commented Aug 28, 2018

just like this:

/** 会员 基础 信息
 * @property string|double $uuid_member_b        default '0' COMMENT '用户唯一标识,有别于 rise_id,任何时候都不会变,可作为唯一性',
 * @property string|double $phone                default '' COMMENT '用户手机号',
 * @property string|double $re_phone             default '' COMMENT '推荐人电话',
 * @property string|double $email                default '' COMMENT '用户邮箱',
 * @property string|double $re_email             default '' COMMENT '推荐人邮箱',
 * @property string|double $pwd                  default '' COMMENT '密码 md5',
 * @property string|double $img                  default '0' COMMENT '用户图像地址',
 * @property string|double $reg_moment           default '注册时刻',
 * @property string|double $last_login_moment    default '0' COMMENT '最后登录时刻',
 * @property string|double $relate_parent_uid    default '上级用户uid',
 * @property string|double $relate_uuid_member_r default '角色表 uuid',
 *
 * @author    [Nevakt,]
 */
class TMemberBase extends PointBaseTable
{
    
    Const _uuid_member_b        = 'uuid_member_b'; // bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '用户唯一标识,有别于 rise_id,任何时候都不会变,可作为唯一性',
    Const _phone                = 'phone'; // varchar(16) NOT NULL DEFAULT '' COMMENT '用户手机号',
    Const _re_phone             = 're_phone'; // varchar(16) NOT NULL DEFAULT '' COMMENT '推荐人电话',
    Const _email                = 'email'; // varchar(100) NOT NULL DEFAULT '' COMMENT '用户邮箱',
    Const _re_email             = 're_email'; // varchar(100) NOT NULL DEFAULT '' COMMENT '推荐人邮箱',
    Const _pwd                  = 'pwd'; // varchar(32) NOT NULL DEFAULT '' COMMENT '密码 md5',
    Const _img                  = 'img'; // varchar(500) NOT NULL DEFAULT '0' COMMENT '用户图像地址',
    Const _reg_moment           = 'reg_moment'; // int(10) unsigned NOT NULL COMMENT '注册时刻',
    Const _last_login_moment    = 'last_login_moment'; // int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时刻',
    Const _relate_parent_uid    = 'relate_parent_uid'; // bigint(20) unsigned NOT NULL COMMENT '上级用户uid',
    Const _relate_uuid_member_r = 'relate_uuid_member_r'; // bigint(20) unsigned NOT NULL COMMENT '角色表 uuid',
}

thank you very much!!

@mfn
Copy link
Collaborator

mfn commented Jun 27, 2020

Comments of columns are supported and are added to the phpdoc.

Default values are not; however if a column is e.g. "nullable", this is taken into consideration and correctly showing string|null instead of string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants