BGPHomepagePhoto:
  actAs: { Timestampable: ~ }
  columns:
    image:                { type: string(255) }
    name:                 { type: string(255) }
    link:                 { type: string(255) }
    position:             { type: integer, default: 0 }
    
BGPContent:
  actAs: 
    Timestampable: ~
    Sluggable:
      fields: [title]
  columns:
    title:                { type: string(255) }
    body:                 { type: string(4000) }
    
BGPMessage:
  actAs: { Timestampable: ~ }
  columns:
    message:              { type: string(4000) }

# Photos and Categories

BGPPhoto:
  actAs: { Timestampable: ~ }
  columns:
    image:                { type: string(255) }
    name:                 { type: string(255) }
    description:          { type: string(4000) }
    position:             { type: integer, default: 0 }
    category_id:          { type: integer }
  relations:
    Category:
      class: BGPCategory
      local: category_id
      foreign: id
      onDelete: SET NULL
    
BGPCategory:
  actAs:
    Timestampable: ~
    Sluggable:
      fields: [name]
  columns:
    name:                 { type: string(255) }

# Cart and Cart Items

BGPCart:
  actAs: { Timestampable: ~ }
  columns:
    user_id:              { type: integer(4) }
  relations:
    User:
      class: sfGuardUser
      local: user_id
      foreign: id
      onDelete: CASCADE
      
BGPCartItem:
  actAs: { Timestampable: ~ }
  columns:
    cart_id:              { type: integer }
    photo_id:             { type: integer }
  relations:
    Cart:
      class: BGPCart
      local: cart_id
      foreign: id
      onDelete: CASCADE
    Photo:
      class: BGPPhoto
      local: photo_id
      foreign: id
      onDelete: CASCADE
