From 0609dfa7bf6256f8eca9c4a7e81933d243c9d9a2 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 30 Oct 2024 19:44:57 +0100 Subject: [PATCH] Try to make it work on more DB dialects --- src/sscce-sequelize-7.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sscce-sequelize-7.ts b/src/sscce-sequelize-7.ts index ec97caf05..2fa777aa9 100644 --- a/src/sscce-sequelize-7.ts +++ b/src/sscce-sequelize-7.ts @@ -23,15 +23,15 @@ export async function run() { }); class Foo extends Model, InferCreationAttributes> { - @Attribute(DataTypes.TEXT) + @Attribute(DataTypes.STRING(100)) @PrimaryKey declare name: string; - @Attribute(DataTypes.TEXT) + @Attribute(DataTypes.STRING(100)) @PrimaryKey declare rank: string; - @Attribute(DataTypes.TEXT) + @Attribute(DataTypes.STRING(100)) declare role: CreationOptional; } @@ -48,7 +48,7 @@ export async function run() { // Altering an unrelated column should not change the above behaviour await Foo.truncate(); - await sequelize.queryInterface.changeColumn("Foos", "role", { type: DataTypes.INTEGER }); + await sequelize.queryInterface.changeColumn("Foos", "role", { type: DataTypes.TEXT }); await expect(Foo.create({ name: "bear", rank: "novice" })).to.eventually.be.fulfilled; await expect(Foo.create({ name: "bear", rank: "expert" })).to.eventually.be.fulfilled; await expect(Foo.create({ name: "dog", rank: "expert" })).to.eventually.be.fulfilled;