Blog Post Examples

model: Post
primaryKey:
    name: id
    type: uuid
fields:
    - { name: title, type: string, nullable: false }
    - { name: content, type: text, nullable: true }
    - { name: status, type: enum, nullable: false, options: ['draft', 'published', 'archived'] }
    - { name: view_count, type: integer, nullable: false }
    - { name: published_at, type: datetime, nullable: true }
timestamps: true
softDeletes: true
relationships:
    - { type: belongsTo, model: User, foreignKey: user_id, ownerKey: id, keyType: uuid }

Last updated