• 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.

    Parameters

    • options: string

    Returns PropertyOrGetterDescriptor

    Example

    class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
    @Attribute(DataTypes.STRING)
    @ColumnName('first_name')
    declare firstName: string;
    }