Skip to content

Commit

Permalink
fix: bump dependencies (#16119)
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik committed Jun 17, 2023
1 parent 99c3530 commit a3213f0
Show file tree
Hide file tree
Showing 7 changed files with 3,559 additions and 2,289 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@
],
"license": "MIT",
"dependencies": {
"@types/debug": "^4.1.7",
"@types/validator": "^13.7.1",
"debug": "^4.3.3",
"dottie": "^2.0.2",
"inflection": "^1.13.2",
"@types/debug": "^4.1.8",
"@types/validator": "^13.7.17",
"debug": "^4.3.4",
"dottie": "^2.0.4",
"inflection": "^1.13.4",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"moment-timezone": "^0.5.35",
"pg-connection-string": "^2.5.0",
"retry-as-promised": "^7.0.3",
"semver": "^7.3.5",
"moment": "^2.29.4",
"moment-timezone": "^0.5.43",
"pg-connection-string": "^2.6.0",
"retry-as-promised": "^7.0.4",
"semver": "^7.5.1",
"sequelize-pool": "^7.1.0",
"toposort-class": "^1.0.1",
"uuid": "^8.3.2",
"validator": "^13.7.0",
"validator": "^13.9.0",
"wkx": "^0.5.0"
},
"devDependencies": {
Expand All @@ -78,7 +78,7 @@
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"acorn": "^8.7.0",
"chai": "^4.3.4",
"chai": "^4.3.7",
"chai-as-promised": "^7.1.1",
"chai-datetime": "^1.8.0",
"cheerio": "^1.0.0-rc.10",
Expand Down Expand Up @@ -123,7 +123,7 @@
"sinon-chai": "^3.7.0",
"snowflake-sdk": "^1.6.6",
"source-map-support": "^0.5.21",
"sqlite3": "npm:@vscode/sqlite3@^5.0.7",
"sqlite3": "^5.1.6",
"tedious": "8.3.0",
"typescript": "^4.5.4"
},
Expand Down
4 changes: 2 additions & 2 deletions src/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2925,7 +2925,7 @@ class Model {
if (include.association.through.model.rawAttributes[attr]._autoGenerated ||
attr === include.association.foreignKey ||
attr === include.association.otherKey ||
typeof associationInstance[include.association.through.model.name][attr] === undefined) {
typeof associationInstance[include.association.through.model.name][attr] === 'undefined') {
continue;
}
values[attr] = associationInstance[include.association.through.model.name][attr];
Expand Down Expand Up @@ -4210,7 +4210,7 @@ class Model {
if (include.association.through.model.rawAttributes[attr]._autoGenerated ||
attr === include.association.foreignKey ||
attr === include.association.otherKey ||
typeof instance[include.association.through.model.name][attr] === undefined) {
typeof instance[include.association.through.model.name][attr] === 'undefined') {
continue;
}
values0[attr] = instance[include.association.through.model.name][attr];
Expand Down
26 changes: 13 additions & 13 deletions test/unit/model/update.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,47 +51,47 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});

describe('Update with multiple models to the same table', () => {
before(function () {
before(function() {
this.Model1 = current.define('Model1', {
value: DataTypes.INTEGER,
name: DataTypes.STRING,
isModel2: DataTypes.BOOLEAN,
model1ExclusiveData: DataTypes.STRING,
model1ExclusiveData: DataTypes.STRING
}, {
tableName: 'model_table',
tableName: 'model_table'
});

this.Model2 = current.define('Model2', {
value: DataTypes.INTEGER,
name: DataTypes.STRING,
name: DataTypes.STRING
}, {
tableName: 'model_table',
tableName: 'model_table'
});
});

beforeEach(function () {
beforeEach(function() {
this.stubQuery = sinon.stub(current, 'query').resolves([]);
});

afterEach(function () {
afterEach(function() {
this.stubQuery.restore();
});

it('updates model1 using model1 model', async function () {
it('updates model1 using model1 model', async function() {
await this.Model1.update({
name: 'other name',
model1ExclusiveData: 'only I can update this field',
model1ExclusiveData: 'only I can update this field'
}, {
where: { value: 1 },
where: { value: 1 }
});
expect(this.stubQuery.lastCall.lastArg.model).to.eq(this.Model1);
});

it('updates model2 using model2 model', async function () {
it('updates model2 using model2 model', async function() {
await this.Model2.update({
name: 'other name',
name: 'other name'
}, {
where: { value: 2 },
where: { value: 2 }
});
expect(this.stubQuery.lastCall.lastArg.model).to.eq(this.Model2);
});
Expand Down
26 changes: 13 additions & 13 deletions test/unit/sql/add-column.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const current = Support.sequelize;
const sql = current.dialect.queryGenerator;

const customSequelize = Support.createSequelizeInstance({
schema: 'custom',
schema: 'custom'
});
const customSql = customSequelize.dialect.queryGenerator;

Expand All @@ -18,18 +18,18 @@ describe(Support.getTestDialectTeaser('SQL'), () => {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
autoIncrement: true
}
}, { timestamps: false });
if (['mysql', 'mariadb'].includes(current.dialect.name)) {

it('properly generate alter queries', () => {
return expectsql(sql.addColumnQuery(User.getTableName(), 'level_id', current.normalizeAttribute({
type: DataTypes.FLOAT,
allowNull: false,
allowNull: false
})), {
mariadb: 'ALTER TABLE `Users` ADD `level_id` FLOAT NOT NULL;',
mysql: 'ALTER TABLE `Users` ADD `level_id` FLOAT NOT NULL;',
mysql: 'ALTER TABLE `Users` ADD `level_id` FLOAT NOT NULL;'
});
});

Expand All @@ -38,41 +38,41 @@ describe(Support.getTestDialectTeaser('SQL'), () => {
type: DataTypes.INTEGER,
references: {
model: 'level',
key: 'id',
key: 'id'
},
onUpdate: 'cascade',
onDelete: 'cascade',
onDelete: 'cascade'
})), {
mariadb: 'ALTER TABLE `Users` ADD `level_id` INTEGER, ADD CONSTRAINT `Users_level_id_foreign_idx` FOREIGN KEY (`level_id`) REFERENCES `level` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;',
mysql: 'ALTER TABLE `Users` ADD `level_id` INTEGER, ADD CONSTRAINT `Users_level_id_foreign_idx` FOREIGN KEY (`level_id`) REFERENCES `level` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;',
mysql: 'ALTER TABLE `Users` ADD `level_id` INTEGER, ADD CONSTRAINT `Users_level_id_foreign_idx` FOREIGN KEY (`level_id`) REFERENCES `level` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;'
});
});

it('properly generate alter queries with FIRST', () => {
return expectsql(sql.addColumnQuery(User.getTableName(), 'test_added_col_first', current.normalizeAttribute({
type: DataTypes.STRING,
first: true,
first: true
})), {
mariadb: 'ALTER TABLE `Users` ADD `test_added_col_first` VARCHAR(255) FIRST;',
mysql: 'ALTER TABLE `Users` ADD `test_added_col_first` VARCHAR(255) FIRST;',
mysql: 'ALTER TABLE `Users` ADD `test_added_col_first` VARCHAR(255) FIRST;'
});
});

it('properly generates alter queries with column level comment', () => {
return expectsql(sql.addColumnQuery(User.getTableName(), 'column_with_comment', current.normalizeAttribute({
type: DataTypes.STRING,
comment: 'This is a comment',
comment: 'This is a comment'
})), {
mariadb: 'ALTER TABLE `Users` ADD `column_with_comment` VARCHAR(255) COMMENT \'This is a comment\';',
mysql: 'ALTER TABLE `Users` ADD `column_with_comment` VARCHAR(255) COMMENT \'This is a comment\';',
mysql: 'ALTER TABLE `Users` ADD `column_with_comment` VARCHAR(255) COMMENT \'This is a comment\';'
});
});
}

it('defaults the schema to the one set in the Sequelize options', () => {
return expectsql(customSql.addColumnQuery(User.getTableName(), 'level_id', customSequelize.normalizeAttribute({
type: DataTypes.FLOAT,
allowNull: false,
allowNull: false
})), {
mariadb: 'ALTER TABLE `Users` ADD `level_id` FLOAT NOT NULL;',
mysql: 'ALTER TABLE `Users` ADD `level_id` FLOAT NOT NULL;',
Expand Down
6 changes: 3 additions & 3 deletions test/unit/sql/remove-column.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const current = Support.sequelize;
const sql = current.dialect.queryGenerator;

const customSequelize = Support.createSequelizeInstance({
schema: 'custom',
schema: 'custom'
});
const customSql = customSequelize.dialect.queryGenerator;

Expand All @@ -19,7 +19,7 @@ describe(Support.getTestDialectTeaser('SQL'), () => {
it('schema', () => {
expectsql(sql.removeColumnQuery({
schema: 'archive',
tableName: 'user',
tableName: 'user'
}, 'email'), {
mssql: 'ALTER TABLE [archive].[user] DROP COLUMN [email];',
db2: 'ALTER TABLE "archive"."user" DROP COLUMN "email";',
Expand All @@ -34,7 +34,7 @@ describe(Support.getTestDialectTeaser('SQL'), () => {

it('defaults the schema to the one set in the Sequelize options', () => {
expectsql(customSql.removeColumnQuery({
tableName: 'user',
tableName: 'user'
}, 'email'), {
mssql: 'ALTER TABLE [user] DROP COLUMN [email];',
db2: 'ALTER TABLE "user" DROP COLUMN "email";',
Expand Down
8 changes: 4 additions & 4 deletions test/unit/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ describe(Support.getTestDialectTeaser('Utils'), () => {

it('defaults symbol keys', () => {
expect(Utils.defaults(
{ a: 1, [Symbol.for('c')]: 3 },
{ a: 1, [Symbol.for('eq')]: 3 },
{ b: 2 },
{ [Symbol.for('c')]: 4, [Symbol.for('d')]: 4 }
{ [Symbol.for('eq')]: 4, [Symbol.for('ne')]: 4 }
)).to.eql({
a: 1,
b: 2,
[Symbol.for('c')]: 3,
[Symbol.for('d')]: 4
[Symbol.for('eq')]: 3,
[Symbol.for('ne')]: 4
});
});
});
Expand Down
Loading

0 comments on commit a3213f0

Please sign in to comment.