ThdFilm:
  tableName: thd_film
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    ref:
      type: string(255)
      notnull: true
    title:
      type: string(255)
      notnull: true
    pitch:
      type: string(2147483647)
      notnull: true
    duration:
      type: integer(4)
      notnull: true
    directors:
      type: string(2147483647)
      notnull: true
    actors:
      type: string(2147483647)
      notnull: true
    slug_url:
      type: string(255)
      notnull: true
    original_title: string(255)
    production_countries:
      type: string(2147483647)
      notnull: true
    production_year: integer(8)
    uniqueid:
      type: string(36)
      notnull: true
  indexes:
    uniqueidindex:
      fields: [uniqueid]
      type: unique    
ThdImage:
  tableName: thd_image
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    file:
      type: string(255)
      notnull: true
    film_id:
      type: integer(4)
      unsigned: 1
      notnull: true
  relations:
    ThdFilm: { onDelete: CASCADE, local: film_id, foreign: id, foreignAlias: images }
ThdSegment:
  tableName: thd_segment
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    title:
      type: string(255)
      notnull: false
    tags:
      type: string(1024)
      notnull: false
    description:
      type: string(2147483647)
      notnull: false
    video_ref:
      type: integer(4)
      notnull: true
    start:
      type: float(2147483647)
      notnull: true
    end:
      type: float(2147483647)
      notnull: true
    user_id:
      type: integer(4)
      notnull: true
    creation_date:
      type: timestamp(25)
      notnull: true
    uniqueid:
      type: string(36)
      notnull: true
    video_id:
      type: integer(4)
      unsigned: 1
      notnull: true
  indexes:
    uniqueidindex:
      fields: [uniqueid]
      type: unique
  relations:
    ThdVideo: { onDelete: CASCADE, local: video_id, foreign: id, foreignAlias: segments }
ThdVideo:
  tableName: thd_video
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    file:
      type: string(255)
      notnull: true
    title: string(255)
    film_id:
      type: integer(4)
      unsigned: 1
      notnull: true
  relations:
    ThdFilm: { onDelete: CASCADE, local: film_id, foreign: id, foreignAlias: videos }