Authassignment Vs Tbl_Auth_Assignment

Hi All,

I would like to know what is the major reason to change the auth assignment table structure on yii 2.0 (if there is any)

both table structures are as below,

Yii 1




create table AuthAssignment[/size]

(

   itemname 			varchar(64) not null,

   userid   			varchar(64) not null,

   bizrule              text,

   data     			text,

   primary key (itemname,userid),

   foreign key (itemname) references AuthItem (name) on delete cascade on update cascade



yii 2.0




create table `tbl_auth_assignment`

(

   `item_name`            varchar(64) not null,

   `user_id`              varchar(64) not null,

   `biz_rule`              text,

   `data`     			text,

   primary key (`item_name`,`user_id`),

   foreign key (`item_name`) references `tbl_auth_item` (`name`) on delete cascade on update cascade) engine InnoDB;



my concern is, [size=“2”] why [/size]column[size=“2”] naming conventions are changed… for ex: column [/size]changed[size=“2”] from ‘userid’ to 'user_id[/size][size=“2”] (any special reason ?)[/size]

[size=“2”]normally when we generate the model we get all the columns as attributes so [/size]wouldn’t[size=“2”] it be nice to leave it the same way ? i juts like to know what kind of advantages could be hidden inside this transition of table [/size]structure[size=“2”]… [/size]

[size=“2”]waiting for someone’s reply.[/size]

[size="2"]Thanks[/size]

It makes sense. The names now follow Yii’s own standards.

Please don’t expect BC: although the team said that they will try to make the transition as easy as possible, this is a major new version, rewrote from the scratch.

I’m sure that the core team will make every effort to bring architectural improvements to Yii 2.0. This will require changes. Please don’t regard these changes as BC-breaking, since there are no hard BC promises.

See https://github.com/yiisoft/yii2/pull/212

Hi Rodrigo, tnx for the reply. i actually wanted to know what standard Yii uses on database related naming convention…

I know that BC is not promised as everything in yii 2 is new. i badly waited to see yii 2 and now i am glad with the public review…

Tnx for all the core developers and supporters

Thanks Ben for your input

Hi Azy,

You can find the conventions (from Yii 1.1) on the guide.

It also meets most mysql naming conventions for field names and table names which is underscores and table names are usually non plural.

Tnx guys :)