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
ThdUser:
  tableName: thd_user
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    uniqueid:
      type: string(255)
      notnull: true  
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
    start:
      type: float(2147483647)
      notnull: true
    end:
      type: float(2147483647)
      notnull: true
    user_id:
      type: integer(4)
      unsigned: 1
      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 }
    ThdUser: { onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: segments }
ThdSegmentTag:
  tableName: thd_segment_tag
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    tag_id:
      type: integer(4)
      unsigned: 1
      notnull: true
    segment_id:
      type: integer(4)
      unsigned: 1
      notnull: true
  relations:
    ThdSegment: { onDelete: CASCADE, local: segment_id, foreign: id }
    ThdTag: { onDelete: CASCADE, local: tag_id, foreign: id }
ThdTag:
  tableName: thd_tag
  columns:
    id:
      type: integer(4)
      unsigned: 1
      primary: true
      autoincrement: true
    tag:
      type: string(255)
      notnull: false
    uniqueid:
      type: string(255)
      notnull: true
  indexes:
    uniqueidindex:
      fields: [uniqueid]
      type: unique
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 }