-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Added JSON type to MySQL and PostgreSQL schema #15560
Conversation
4536009
to
d3ed839
Compare
d3ed839
to
da1bd89
Compare
@SilverFire I think you'd like to take a look at it. |
@samdark FYI I want to separate that PR with excluding "Fixed default values loaded from schema for PostgreSQL" commit because I fix it for test passing on PostgreSQL 9.6. Another important question for me is why Travis tests works on outdated and rarely used versions of databases servers? Where can I read about that decision policy? |
Travis works with whatever is provided by default. We can merge adjusted travis.yml if needed. |
@zhukovra would you please merge with master? Also... what's left for the pull request to be finished? |
@samdark I'll try finish PR today or tomorrow. |
da1bd89
to
99ba1e1
Compare
Please pay attention to changes introduced by #15348 |
Yes, throw exception and leave a |
99ba1e1
to
61a1957
Compare
@SilverFire @samdark please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally code is fine. There are minor issues to fix and questions to answer. Also a line for changelog is needed.
.travis.yml
Outdated
- mysql-5.7-trusty | ||
packages: | ||
- libmysqlclient-dev | ||
- libmysqlclient20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are both libraries necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Copypaste from outdated Travis instruction. Fixed.
.travis.yml
Outdated
packages: | ||
- libmysqlclient-dev | ||
- libmysqlclient20 | ||
- mysql-community-client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a client?
.travis.yml
Outdated
- mysql-client-core-5.6 | ||
- mysql-client-5.6 | ||
- libmysqlclient-dev | ||
- libmysqlclient20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
.travis.yml
Outdated
- mysql-client-core-5.6 | ||
- mysql-client-5.6 | ||
- libmysqlclient-dev | ||
- libmysqlclient20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
framework/db/SchemaBuilderTrait.php
Outdated
@@ -272,4 +272,25 @@ public function money($precision = null, $scale = null) | |||
|
|||
return $this->getDb()->getSchema()->createColumnSchemaBuilder(Schema::TYPE_MONEY, $length); | |||
} | |||
|
|||
/** | |||
* Creates a json column. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
json -> JSON
framework/db/SchemaBuilderTrait.php
Outdated
*/ | ||
public function json() | ||
{ | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's not a phpdoc block, use /*
with single *
.
framework/db/SchemaBuilderTrait.php
Outdated
/** | ||
* TODO Remove in Yii 2.1 | ||
* | ||
* Disabled due bug in MySQL extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to bug
tests/framework/db/SchemaTest.php
Outdated
@@ -249,7 +249,7 @@ public function testGetPDOType() | |||
|
|||
public function getExpectedColumns() | |||
{ | |||
return [ | |||
$columns = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning it right away was fine.
]); | ||
]; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use /*
As I understand, this PR fixes everything that #15266 was going to fix, right? |
61a1957
to
479c8da
Compare
479c8da
to
b3aac82
Compare
@samdark I think that bugs #15266 was fixed by @SilverFire. PR updated. Thank you for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
A line for changelog is needed. |
@@ -4,6 +4,7 @@ Yii Framework 2 Change Log | |||
2.0.14 under development | |||
------------------------ | |||
|
|||
- Enh #13019: Support JSON in SchemaBuilderTrait (zhukovra, undefinedor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samdark but it is already there
Merged. Thank you! |
Hello every one!
First my think - is create own QueryBuilder width $typeMap = [ |
@titanproger Hi, i also encountered this issue, may be you created a new issue? |
This is fixed and tests enriched PR #13783.
Correct realization of PR #15266.
Status: working on tests stabilization under new versions of DBs.