Skip to content

Question about migrations and sequelize-typescript #9

@hmol

Description

@hmol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions