# Version SVN: $Id: 10_roles_schema.yml 1927 2013-08-11 10:08:58Z sven.poeche $
propel:
  role:
    _attributes:            { phpName: Role, allowPkInsert: true, isI18N: true, i18nTable: role_i18n }
    rid:                    { type: integer, size:  11, required: true, primaryKey: true, autoIncrement: true } # 0 = user, 1 = moderator, 2 = admin, 3 = superadmin
    status:                 { type: integer, size:  11, required: true, default: 0 } # 0=created, 1=verify, 2=illegal, 3=legal, 4=deleted
    weight:                 { type: integer, size:  11, required: true, default: 0 }
    created_at:             { type: timestamp, required: true }
    updated_at:             { type: timestamp, required: true }


  role_i18n:
    _attributes:            { phpName: RoleI18n, allowPkInsert: true }
    rid:                    { 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:
      ri_fk_rid:            { foreignTable: role, references: [ {local: rid, foreign: rid} ] }
    _indexes:
      ri_i_rid:             [rid]
      ri_i_culture:         [culture]


  role_permission:
    _attributes:            { phpName: RolePermission, allowPkInsert: true }
    rid:                    { type: integer, size:  11, required: true, primaryKey: true }
    perm:                   { type: varchar, size: 255, required: true, primaryKey: true }
    created_at:             { type: timestamp, required: true }
    _foreignKeys:
      rp_fk_rid:            { foreignTable: role, references: [ {local: rid, foreign: rid} ] }
    _indexes:
      rp_i_rid:             [rid]
      rp_i_perm:            [perm]


