Skip to content

@Default decorator throws error #718

Open
@byronferguson

Description

@byronferguson

Versions

  • sequelize: 5.21.2
  • sequelize-typescript: 1.1.0
  • typescript: 3.7.3

I'm submitting a ...

[ x ] bug report
[ ] feature request

Actual behavior:
Error: @Column annotation is missing for "sort" of class "CampaignPhase" or annotation order is wrong.

Currently throwing an error. (does the same thing with @Comment() too

Expected behavior:
generate the DEFAULT_VALUE in the database engine

Related code:

@Table
export class CampaignPhase extends Model<CampaignPhase> {
  @Column
  name!: string;

  @Column
  @NotNull
  @Default(1)
  sort!: number;

  @ForeignKey(() => CampaignTemplate)
  @Column
  templateId!: number;

  @BelongsTo(() => CampaignTemplate)
  template?: CampaignTemplate;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions