Skip to content

Conversation

@uldisn
Copy link
Contributor

@uldisn uldisn commented Nov 11, 2019

Signed-off-by: uldisn uldisnelsons@gmail.com

Q A
Is bugfix? yes
New feature? yes
Breaks BC? no
Tests pass? yes
Fixed issues -

New features

  1. added type float (MySql: decimal, float, money, double)

  2. If column value can be null, property type for example for string column set like this

/**
 * @property string|null $car_number
 */

Bug

For MySql table

CREATE TABLE `csc_car_unload` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `task_id` smallint(5) unsigned NOT NULL,
  `delivery_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `task_id` (`task_id`),
  KEY `delivery_id` (`delivery_id`),
  CONSTRAINT `csc_car_unload_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `csc_task` (`id`),
  CONSTRAINT `csc_car_unload_ibfk_2` FOREIGN KEY (`delivery_id`) REFERENCES `cmd_delivery` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5948 DEFAULT CHARSET=latin1

Properties $id and $delivery_id type is generated as string, but must be integer

/**
 * This is the base-model class for table "csc_car_unload".
 *
 * @property string $id
 * @property integer $task_id
 * @property string $delivery_id
 *
 * @property \coalmar\screen\models\CscTask $task
 * @property \coalmar\screen\models\CmdDelivery $delivery
 */

@samdark samdark added the pr:missing usecase It is not clear what is the use case for the pull request. label Nov 11, 2019
@yii-bot
Copy link

yii-bot commented Nov 11, 2019

Thank you for putting effort in the improvement of the Yii framework.
We have reviewed your pull request.

Unfortunately a use case is missing. It is required to get a better understanding of the pull request and helps us to determine the necessity and applicability of the suggested change to the framework.

Could you supply us with a use case please? Please be as detailed as possible and show some code!

Thanks!

This is an automated comment, triggered by adding the label pr:missing usecase.

@uldisn
Copy link
Contributor Author

uldisn commented Nov 11, 2019

Updated: #416 (comment)

@samdark samdark added type:bug Bug type:enhancement Enhancement and removed pr:missing usecase It is not clear what is the use case for the pull request. labels Nov 12, 2019
Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK. Please add lines for changelog.md and I'll merge it.

@samdark samdark added this to the 2.1.2 milestone Nov 12, 2019
@samdark samdark added the status:ready for merge The pull request is OK to be merged. label Nov 12, 2019
Signed-off-by: uldisn <uldisnelsons@gmail.com>
@uldisn
Copy link
Contributor Author

uldisn commented Nov 13, 2019

Looks OK. Please add lines for changelog.md and I'll merge it.

Done

@samdark samdark merged commit 71497f7 into yiisoft:master Nov 13, 2019
@samdark
Copy link
Member

samdark commented Nov 13, 2019

Merged. Thank you!

@samdark samdark removed the status:ready for merge The pull request is OK to be merged. label Nov 13, 2019
uldisn added a commit to uldisn/yii2-gii that referenced this pull request Nov 16, 2019
Fix yiisoft#416: Improved generation of model attributes and type annotations
@samdark samdark modified the milestones: 2.1.2, 2.1.3 Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants