不要怂,就是干,撸起袖子干!

Commit b6e1c154 by Michael Gauthier Committed by Sushant

Update to UUID 3.X package. (#6919)

* Update to uuid@3.x package.

The node-uuid package is deprecated.

The new 3.x version drops the parse and unparse methods which were used in instance integration tests. Tests were updated to use uuid-validate package to validate UUID generation.

* Update changelog Future for PR #6919 - update uuid package.
1 parent 9b73d157
# Future
- [CHANGED] Updated deprecated `node-uuid` package to `uuid` [#6919](https://github.com/sequelize/sequelize/pull/6919)
- [ADDED] UPSERT Support for MSSQL [#6842](https://github.com/sequelize/sequelize/pull/6842)
- [FIXED] Execute queries parallel in findAndCount [#6695](https://github.com/sequelize/sequelize/issues/6695)
- [FIXED] `restore` now uses `field` from `deletedAt`
......
......@@ -10,7 +10,7 @@ const Dottie = require('dottie');
const BelongsTo = require('../../associations/belongs-to');
const BelongsToMany = require('../../associations/belongs-to-many');
const HasMany = require('../../associations/has-many');
const uuid = require('node-uuid');
const uuid = require('uuid');
const semver = require('semver');
const QueryGenerator = {
......
......@@ -3,7 +3,7 @@
const Utils = require('../../utils');
const debug = Utils.getLogger().debugContext('sql:mysql');
const AbstractQuery = require('../abstract/query');
const uuid = require('node-uuid');
const uuid = require('uuid');
const sequelizeErrors = require('../../errors.js');
const _ = require('lodash');
......
'use strict';
const Utils = require('./utils');
const uuid = require('node-uuid');
const uuid = require('uuid');
/**
* The transaction object is used to identify a running transaction. It is created by calling `Sequelize.transaction()`.
......
......@@ -5,7 +5,7 @@ const SqlString = require('./sql-string');
const _ = require('lodash').runInContext(); // Prevent anyone messing with template settings by creating a fresh copy
const parameterValidator = require('./utils/parameter-validator');
const Logger = require('./utils/logger');
const uuid = require('node-uuid');
const uuid = require('uuid');
const Promise = require('./promise');
const primitives = ['string', 'number', 'boolean'];
......
......@@ -47,7 +47,7 @@
"lodash": "^4.17.1",
"moment": "^2.13.0",
"moment-timezone": "^0.5.4",
"node-uuid": "^1.4.4",
"uuid": "^3.0.0",
"retry-as-promised": "^2.0.0",
"semver": "^5.0.1",
"terraformer-wkt-parser": "^1.1.2",
......@@ -80,7 +80,8 @@
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0",
"sqlite3": "^3.1.4",
"tedious": "^1.14.0"
"tedious": "^1.14.0",
"uuid-validate": "^0.0.2"
},
"keywords": [
"mysql",
......
......@@ -10,7 +10,7 @@ var chai = require('chai')
, _ = require('lodash')
, moment = require('moment')
, current = Support.sequelize
, uuid = require('node-uuid')
, uuid = require('uuid')
, DataTypes = require('../../lib/data-types')
, dialect = Support.getTestDialect()
, semver = require('semver');
......
......@@ -10,7 +10,7 @@ var chai = require('chai')
, dialect = Support.getTestDialect()
, config = require(__dirname + '/../config/config')
, sinon = require('sinon')
, uuid = require('node-uuid')
, validateUUID = require('uuid-validate')
, current = Support.sequelize;
describe(Support.getTestDialectTeaser('Instance'), function() {
......@@ -703,10 +703,10 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
expect(user.uuidv4).to.have.length(36);
});
it('should store a valid uuid in uuidv1 and uuidv4 that can be parsed to something of length 16', function() {
it('should store a valid uuid in uuidv1 and uuidv4 that conforms to the UUID v1 and v4 specifications', function() {
var user = this.User.build({ username: 'a user'});
expect(uuid.parse(user.uuidv1)).to.have.length(16);
expect(uuid.parse(user.uuidv4)).to.have.length(16);
expect(validateUUID(user.uuidv1, 1)).to.be.true;
expect(validateUUID(user.uuidv4, 4)).to.be.true;
});
it('should store a valid uuid if the field is a primary key named id', function() {
......
......@@ -5,7 +5,7 @@ var Support = require(__dirname + '/../support')
, Sequelize = Support.Sequelize
, chai = require('chai')
, util = require('util')
, uuid = require('node-uuid')
, uuid = require('uuid')
, expectsql = Support.expectsql
, current = Support.sequelize
, expect = chai.expect;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!