# Version SVN: $Id: 20_categories_schema.yml 3195 2013-12-11 11:38:22Z sven.poeche $
propel:
  category:
    _attributes:            { phpName: Category, allowPkInsert: true, isI18N: true, i18nTable: category_i18n }
    cid:                    { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true }
    pid:                    { type: integer, size:  11, required: false }
    categorytype:           { type: integer, size:  11, required: true } # 0=all, 10=video, 11=photo, 12=audio, 13=document, 100=media, 101=group, 102=channel
    status:                 { type: integer, size:  11, required: true, default: 0 } # 0=created, 1=verify, 2=illegal, 3=legal, 4=deleted
    picture_filename:       { type: varchar, size: 255 } # filename of the category picture
    weight:                 { type: integer, size:  11, required: true, default: 0 }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }
    _indexes:
      ca_i_pid:             [pid]
    _foreignKeys:
      ca_fk_pid:            { foreignTable: category, references: [ {local: pid, foreign: cid} ] }


  category_i18n:
    _attributes:            { phpName: CategoryI18n, allowPkInsert: true }
    cid:                    { 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:
      ci_fk_cid:            { foreignTable: category, references: [ {local: cid, foreign: cid} ] }
    _indexes:
      ci_i_cid:             [cid]
      ci_i_culture:         [culture]


