Sets the name of the column (in the database) this attribute maps to. It is a shortcut for setting the columnName option of the Attribute decorator.
columnName
With a good naming strategy configured, you rarely need to use this decorator. Learn about naming strategies in our documentation.
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { @Attribute(DataTypes.STRING) @ColumnName('first_name') declare firstName: string;} Copy
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { @Attribute(DataTypes.STRING) @ColumnName('first_name') declare firstName: string;}
Sets the name of the column (in the database) this attribute maps to. It is a shortcut for setting the
columnName
option of the Attribute decorator.With a good naming strategy configured, you rarely need to use this decorator. Learn about naming strategies in our documentation.