From 4c0f068b94c19d59b6d3e334de34fcfe97f7b8d6 Mon Sep 17 00:00:00 2001 From: thommt Date: Fri, 28 Feb 2025 17:59:20 -0500 Subject: [PATCH 1/2] Update sscce-sequelize-6.ts --- src/sscce-sequelize-6.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sscce-sequelize-6.ts b/src/sscce-sequelize-6.ts index 132a311d5..d0364cd24 100644 --- a/src/sscce-sequelize-6.ts +++ b/src/sscce-sequelize-6.ts @@ -4,7 +4,7 @@ import { expect } from 'chai'; import sinon from 'sinon'; // if your issue is dialect specific, remove the dialects you don't need to test on. -export const testingOnDialects = new Set(['mssql', 'sqlite', 'mysql', 'mariadb', 'postgres', 'postgres-native']); +export const testingOnDialects = new Set(['postgres', 'postgres-native']); // You can delete this file if you don't want your SSCCE to be tested against Sequelize 6 @@ -25,16 +25,17 @@ export async function run() { Foo.init({ name: DataTypes.TEXT, + genre: { + type:DataTypes.ENUM('a', 'b'), + comment: 'Genre of the foo', + } }, { sequelize, modelName: 'Foo', }); // You can use sinon and chai assertions directly in your SSCCE. - const spy = sinon.spy(); - sequelize.afterBulkSync(() => spy()); - await sequelize.sync({ force: true }); - expect(spy).to.have.been.called; + await sequelize.sync({ alter: true }); console.log(await Foo.create({ name: 'TS foo' })); expect(await Foo.count()).to.equal(1); From df5061d6d5f2896fec7e11bb4c4372c2161a83ec Mon Sep 17 00:00:00 2001 From: thommt Date: Fri, 28 Feb 2025 18:01:01 -0500 Subject: [PATCH 2/2] Delete src/sscce-sequelize-7.ts --- src/sscce-sequelize-7.ts | 43 ---------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/sscce-sequelize-7.ts diff --git a/src/sscce-sequelize-7.ts b/src/sscce-sequelize-7.ts deleted file mode 100644 index 603cb219c..000000000 --- a/src/sscce-sequelize-7.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { CreationOptional, DataTypes, InferAttributes, InferCreationAttributes, Model } from '@sequelize/core'; -import { Attribute, NotNull } from '@sequelize/core/decorators-legacy'; -import { createSequelize7Instance } from '../dev/create-sequelize-instance'; -import { expect } from 'chai'; -import sinon from 'sinon'; - -// if your issue is dialect specific, remove the dialects you don't need to test on. -export const testingOnDialects = new Set(['mssql', 'sqlite', 'mysql', 'mariadb', 'postgres', 'postgres-native']); - -// You can delete this file if you don't want your SSCCE to be tested against Sequelize 7 - -// Your SSCCE goes inside this function. -export async function run() { - // This function should be used instead of `new Sequelize()`. - // It applies the config for your SSCCE to work on CI. - const sequelize = createSequelize7Instance({ - logQueryParameters: true, - benchmark: true, - define: { - // For less clutter in the SSCCE - timestamps: false, - }, - }); - - class Foo extends Model, InferCreationAttributes> { - declare id: CreationOptional; - - @Attribute(DataTypes.TEXT) - @NotNull - declare name: string; - } - - sequelize.addModels([Foo]); - - // You can use sinon and chai assertions directly in your SSCCE. - const spy = sinon.spy(); - sequelize.afterBulkSync(() => spy()); - await sequelize.sync({ force: true }); - expect(spy).to.have.been.called; - - console.log(await Foo.create({ name: 'TS foo' })); - expect(await Foo.count()).to.equal(1); -}