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

[5.2] Add "Generated Columns" support to MySQL schema grammar #13430

Merged
merged 1 commit into from
May 6, 2016
Merged

[5.2] Add "Generated Columns" support to MySQL schema grammar #13430

merged 1 commit into from
May 6, 2016

Conversation

themsaid
Copy link
Member

@themsaid themsaid commented May 4, 2016

$table->discounted_price->virtualAs('price - 5');

$table->discounted_price->storedAs('price - 5');

This generates Virtual and Stored generated columns introduced in MySQL 5.7.6.

For Reference:
http://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html

*
* @param \Illuminate\Database\Schema\Blueprint $blueprint
* @param \Illuminate\Support\Fluent $column
* @return string|null
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be string|void

Copy link
Member

Choose a reason for hiding this comment

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

no

Copy link
Member

Choose a reason for hiding this comment

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

void cannot be unioned with anything

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you elaborate on that ? References ?

Copy link
Member

Choose a reason for hiding this comment

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

laravel considers void to mean garbage, not "no return"

Copy link
Member

Choose a reason for hiding this comment

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

it is possible that definition is changing in php 7.1, but for now, we're sticking with our original definition

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

Successfully merging this pull request may close these issues.

4 participants