sequelize-cli-typescript icon indicating copy to clipboard operation
sequelize-cli-typescript copied to clipboard

Question about migrations and sequelize-typescript

Open hmol opened this issue 5 years ago • 0 comments

I have a question about the usage of this cli and sequelize-typescript

What I want, is to define a model, with decorators, like this /src/models/user.ts:

export class userModel extends Model {
    @AllowNull(false)
    @Column({
        type: DataType.TEXT,
    })
    name: string;
    
    @AllowNull(false)
    @Column({
        type: DataType.DATE,
    })
    birthDate: Date;
}

And then to make sequelize migrations like this: sequelize migration:generate --models-path ./src/models --name added_new_userModel

Anybody out there that thinks this can be done? Or has any idea about what needs to be done. If I have the time, I can contribute to this smile

hmol avatar Apr 23 '20 07:04 hmol