# Version SVN: $Id: 41_media_fields_schema.yml 6382 2019-01-08 11:25:07Z stefan.ganz $
propel:
  media_field:
    _attributes:            { phpName: MediaField, allowPkInsert: true, isI18N: true, i18nTable: media_field_i18n }
    mfid:                   { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    fieldtype:              { type: integer, size:  11, required: true }
    fieldname:              { type: varchar, size: 255, required: true }
    required:               { type: boolean, size:   1, required: true, default: false }
    hidden:                 { type: boolean, size:   1, required: true, default: false }
    readonly:               { type: boolean, size:   1, required: true, default: false }
    defaultvalue:           { type: varchar, size: 255 }
    maxlength:              { type: integer, size:  11, required: false }
    min:                    { type: varchar, size: 255, required: false }
    max:                    { type: varchar, size: 255, required: false }
    weight:                 { type: integer, size:  11, required: true, default: 0 }
    status:                 { type: integer, size:  11, required: true, default: 0 }
    open_in_new_tab:        { type: boolean, size:   1, required: true, default: false }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _foreignKeys:
    _indexes:
      mfi_i_mfid:           [mfid]
      mfi_i_fieldtype:      [fieldtype]
      mfi_i_fieldname:      [fieldname]


  media_field_i18n:
    _attributes:            { phpName: MediaFieldI18n, allowPkInsert: true }
    mfid:                   { type: integer, size:  11, required: true, primaryKey: true }
    culture:                { type: varchar, size:   7, required: true, primaryKey: true, isCulture: true }
    name:                   { type: varchar, size: 255, required: true }
    description:            { type: longvarchar }
    _foreignKeys:
      mfii_fk_mfid:         { foreignTable: media_field, references: [ {local: mfid, foreign: mfid} ] }
    _indexes:
      mfii_i_mfid:          [mfid]
      mfii_i_culture:       [culture]


  media_field_option:
    _attributes:            { phpName: MediaFieldOption, allowPkInsert: true, isI18N: true, i18nTable: media_field_option_i18n }
    mfoid:                  { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    mfid:                   { type: integer, size:  11, required: true }
    value:                  { type: varchar, size: 255, required: true }
    weight:                 { type: integer, size:  11, required: true, default: 0 }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _foreignKeys:
       mfo_fk_ufid:         { foreignTable: media_field, references: [ {local: mfid, foreign: mfid} ] }
    _indexes:
      mfo_i_mfid:           [mfid]
      mfo_i_value:          [value]


  media_field_option_i18n:
    _attributes:            { phpName: MediaFieldOptionI18n, allowPkInsert: true }
    mfoid:                  { type: integer, size:  11, required: true, primaryKey: true }
    culture:                { type: varchar, size:   7, required: true, primaryKey: true, isCulture: true }
    name:                   { type: varchar, size: 255, required: true }
    _foreignKeys:
      mfoi_fk_mfoid:       { foreignTable: media_field_option, references: [ {local: mfoid, foreign: mfoid} ] }
    _indexes:
      mfoi_i_mfoid:        [mfoid]
      mfoi_i_culture:      [culture]


  media_field_value:
    _attributes:            { phpName: MediaFieldValue, allowPkInsert: true }
    mid:                    { type: integer, size:  11, required: true, primaryKey: true }
    mfid:                   { type: integer, size:  11, required: true, primaryKey: true }
    value:                  { type: longvarchar }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _foreignKeys:
       mfv_fk_mfid:         { foreignTable: media_field, references: [ {local: mfid, foreign: mfid} ] }
       mfv_fk_mid:          { foreignTable: media, references: [ {local: mid, foreign: mid} ] }
    _indexes:
      mfv_i_mfid:           [mfid]
      mfv_i_mid:            [mid]


