Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
fix(mysql): Add parentheses to default value #12231
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12231 +/- ##
==========================================
+ Coverage 96.33% 96.35% +0.01%
==========================================
Files 95 95
Lines 9118 9127 +9
==========================================
+ Hits 8784 8794 +10
+ Misses 334 333 -1
Continue to review full report at Codecov.
|
|
Add a test in this file https://github.com/sequelize/sequelize/blob/master/test/integration/data-types.test.js Create a model with |
| // MySQL 5.7 or above doesn't support POINT EMPTY | ||
| if (dialect === 'mysql' && semver.gte(current.options.databaseVersion, '5.7.0')) { | ||
| return; | ||
| } | ||
|
|
||
| it('should return parenteses when default values is a function', function() { |
sushantdhiman
May 19, 2020
Contributor
Some changes
- This
itblock is placed inside anotheritblock so it won't execute. Please move it outside ofit('should parse an empty GEOMETRY field', () => {block - You should use async/await
| }).then(() => { | ||
| return Model.findOne({ where: { id: 1 } }); | ||
| }).then(user => { | ||
| expect(user.get('double')).to.eq(Infinity); |
JuarezLustosa
May 19, 2020
Author
Contributor
Hey @sushantdhiman . Thank you for your support.
I've been troubling whit this test. When I put the function on default, it is trying to create on the database, and on the test, the version of MySQL is 5.7, so it can't happen cuz this version does not support this parenthesis. What do you do in those cases?
Thank you again.
Cheers

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Pull Request check-list
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
On 5.7 Do not accept default with parentheses.
We have this error
- On Version 8 accept
This same query creates the table, so it works as well.
I don't know how the project works with old versions. It up to you guys.