diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 3a13906f06..233de49f07 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -41,19 +41,26 @@ s.transaction().then( ( a ) => t = a ); // ~~~~~~~~~~ // -interface GUserAttributes { - id? : number; +interface GUserCreationAttributes { + id? : number username? : string; email: string; } -interface GUserInstance extends Sequelize.Instance {} -const GUser = s.define('user', { +interface GUserAttributes { + id : number; + username? : string; + email: string; +} + +interface GUserInstance extends Sequelize.Instance, GUserAttributes {} +const GUser = s.define('user', { id: Sequelize.INTEGER, username: Sequelize.STRING, email: Sequelize.STRING }); GUser.create({ id : 1, username : 'one', email: 'one@lol.com' }).then((guser) => guser.save()); +GUser.create({ email: 'two@lol.com' }).then((guser) => guser.save()) var schema : Sequelize.DefineAttributes = { key : { type : Sequelize.STRING, primaryKey : true },