Documentation
    Preparing search index...

    Class ENUM<Member>

    An enumeration, Postgres Only

    Fallback policy: If this type is not supported, it will be replaced by a string type with a CHECK constraint to enforce a list of values.

    DataTypes.ENUM('value', 'another value')
    DataTypes.ENUM(['value', 'another value'])
    DataTypes.ENUM({
    values: ['value', 'another value'],
    });

    Type Parameters

    • Member extends string

    Hierarchy (View Summary)

    Index
    usageContext: DataTypeUseContext | undefined

    Where this DataType is being used.

    • Called when a value is retrieved from the Database, and its DataType is specified. Used to normalize values from the database.

      Note: It is also possible to do an initial parsing of a Database value using AbstractDialect#registerDataTypeParser. That normalization uses the type ID from the database instead of a Sequelize Data Type to determine which parser to use, and is called before this method.

      Parameters

      • value: unknown

        The value to parse.

      Returns unknown