---
Task:
  tableName: tasks
  columns:
    name: &TASKNAME
      type: string(64)
      notnull: true
      primary: true
    class:
      type: string(128)
      notnull: true
    plugin: string(32)
    context:
      type: string(32)
      notnull: true
  indexes:
    name:
      fields: [name]
  relations:
    Plugin:
      local: plugin
      foreign: name
      foreignAlias: Tasks
      onUpdate: cascade
      onDelete: cascade

TaskAlias:
  tableName: task_aliases
  columns:
    name: *TASKNAME
    alias_for:
      type: string(64)
      notnull: true
    plugin: string(32)
    context:
      type: string(32)
      notnull: true
  relations:
    Task:
      local: alias_for
      foreign: name
      alias: Task
      foreignAlias: Aliases
      onUpdate: cascade
      onDelete: cascade
