prorm API Reference
    Preparing search index...

    Interface FieldDefinition

    interface FieldDefinition {
        name?: string;
        type: string | { key?: string; toSqlString?: () => string };
        primaryKey?: boolean;
        foreignKey?: boolean;
        unique?: boolean;
        allowNull?: boolean;
        defaultValue?: any;
        autoIncrement?: boolean;
        references?: { model: string; key: string };
        comment?: string;
        validate?: Record<string, any>;
        enum?: string[];
    }
    Index
    name?: string
    type: string | { key?: string; toSqlString?: () => string }
    primaryKey?: boolean
    foreignKey?: boolean

    Treated as FK even without references when set to true

    unique?: boolean
    allowNull?: boolean
    defaultValue?: any
    autoIncrement?: boolean
    references?: { model: string; key: string }
    comment?: string
    validate?: Record<string, any>
    enum?: string[]