# Version SVN: $Id: 31_user_fields_schema.yml 3781 2015-05-27 15:53:07Z anton.salov $
propel:
  user_field:
    _attributes:            { phpName: UserField, allowPkInsert: true, isI18N: true, i18nTable: user_field_i18n }
    ufid:                   { 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 }
    registration:           { 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 }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _foreignKeys:
    _indexes:
      ufi_i_ufid:           [ufid]
      ufi_i_fieldtype:      [fieldtype]
      ufi_i_fieldname:      [fieldname]


  user_field_i18n:
    _attributes:            { phpName: UserFieldI18n, allowPkInsert: true }
    ufid:                   { 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:
      ufii_fk_ufid:         { foreignTable: user_field, references: [ {local: ufid, foreign: ufid} ] }
    _indexes:
      ufii_i_ufid:          [ufid]
      ufii_i_culture:       [culture]


  user_field_option:
    _attributes:            { phpName: UserFieldOption, allowPkInsert: true, isI18N: true, i18nTable: user_field_option_i18n }
    ufoid:                  { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    ufid:                   { 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:
       ufo_fk_ufid:         { foreignTable: user_field, references: [ {local: ufid, foreign: ufid} ] }
    _indexes:
      ufo_i_ufid:           [ufid]
      ufo_i_value:          [value]


  user_field_option_i18n:
    _attributes:            { phpName: UserFieldOptionI18n, allowPkInsert: true }
    ufoid:                  { 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:
      ufoi_fk_ufoid:       { foreignTable: user_field_option, references: [ {local: ufoid, foreign: ufoid} ] }
    _indexes:
      ufoi_i_ufoid:        [ufoid]
      ufoi_i_culture:      [culture]


  user_field_value:
    _attributes:            { phpName: UserFieldValue, allowPkInsert: true }
    uid:                    { type: integer, size:  11, required: true, primaryKey: true }
    ufid:                   { type: integer, size:  11, required: true, primaryKey: true }
    value:                  { type: longvarchar }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _foreignKeys:
       ufv_fk_ufid:         { foreignTable: user_field, references: [ {local: ufid, foreign: ufid} ] }
       ufv_fk_uid:          { foreignTable: user, references: [ {local: uid, foreign: uid} ] }
    _indexes:
      ufv_i_ufid:           [ufid]
      ufv_i_uid:            [uid]


