---
detect_relations: true

Plugin:
  tableName: plugins
  columns:
    name:
      type: string(32)
      notnull: true
      primary: true
    description: string(512)
    release_version:
      type: string(32)
      notnull: true
    enabled: boolean

PluginParameter:
  tableName: plugin_parameters
  columns:
    plugin_name: &PLUGIN_NAME
      type: string(32)
      notnull: true
      primary: true
    name:
      type: string(32)
      notnull: true
      primary: true
    value: string
  relations:
    Plugin:
      foreignAlias: Parameters
      local: plugin_name
      foreign: name
      onUpdate: cascade
      onDelete: cascade

HookBinding:
  tableName: hook_bindings
  columns:
    id: &ID
      type: integer
      primary: true
      autoincrement: true
      unsigned: true
    plugin_name: string(32)
    name:
      type: string(128)
      notnull: true
    class:
      type: string(128)
      notnull: true
    method: string(128)
    singleton: boolean
  relations:
    Plugin:
      foreignAlias: HookBindings
      local: plugin_name
      foreign: name
      onUpdate: cascade
      onDelete: cascade
