prorm API Reference
    Preparing search index...

    Enumeration ReferentialAction

    Referential actions for foreign key constraints (onDelete / onUpdate).

    This enum is a companion to the existing string-literal unions used for onDelete/onUpdate fields (e.g. 'CASCADE' | 'RESTRICT' | ...). Both forms are accepted wherever these fields appear, so existing string literals continue to work unchanged.

    import { ReferentialAction } from 'prorm';

    User.hasMany(Post, {
    foreignKey: 'userId',
    onDelete: ReferentialAction.Cascade,
    onUpdate: ReferentialAction.Cascade,
    });

    // Equivalent to the string-literal form:
    User.hasMany(Post, {
    foreignKey: 'userId',
    onDelete: 'CASCADE',
    onUpdate: 'CASCADE',
    });
    Index
    Cascade: "CASCADE"
    Restrict: "RESTRICT"
    SetNull: "SET NULL"
    NoAction: "NO ACTION"
    SetDefault: "SET DEFAULT"