edit Current DBMS... 設(shè)置dbms的屬性,找到mysql5.0-->script-->objects-->column-->add " />
在Database-->edit Current DBMS...
設(shè)置dbms的屬性,找到mysql5.0-->script-->objects-->column-->add
把原來(lái)的內(nèi)容:
%20:COLUMN% [%National%?national ]%DATATYPE%[%Unsigned%? unsigned][%ZeroFill%? zerofill][ [.O:[character set][charset]] %CharSet%][.Z:[ %NOTNULL%][%IDENTITY%? auto_increment:[ default %DEFAULT%]][ comment %.q:@OBJTLABL%]]
改為:
%20:COLUMN% [%National%?national ]%DATATYPE%[%Unsigned%? unsigned][%ZeroFill%? zerofill][ [.O:[character set][charset]] %CharSet%][.Z:[ %NOTNULL%][%IDENTITY%? auto_increment:[ default %DEFAULT%]][ comment %.q:COMMENT%]]
呵呵,其實(shí)只有最后的OBJTLABL改為COMMENT就行了。以前的OBJTLABL不知道指什么,知道的朋友告訴一下。。
這樣生成的代碼每個(gè)字段就有注釋了:
create table `user`( uid int not null comment '用戶ID', username varchar(255) not null comment '用戶名', password char(32) not null comment '密碼', gid int not null comment '用戶組', primary key (uid));alter table `user` comment '用戶表';
表的注釋:
默認(rèn)應(yīng)該都是有表注釋的,如果沒有的話可以根擾下面的方法進(jìn)行設(shè)置。
設(shè)置dbms的屬性,找到mysql5.0-->script-->objects-->Table-->TableComment:
value中,增加如下內(nèi)容
alter table [%QUALIFIER%]%TABLE% comment %.60qA:COMMENT%
增加后就會(huì)生成下面語(yǔ)句:
alter table code comment '代碼表';
代碼生成:
點(diǎn)擊菜單Database-->generate Database
出現(xiàn)database generation屏幕:在Format tab頁(yè)中,勾選generate name in empty comment
單擊確定就可以生成相應(yīng)的代碼,代碼中就會(huì)出現(xiàn)上面的注釋了。
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com