--- options: collate: utf8_czech_ci charset: utf8 Product: actAs: Timestampable: ~ Sluggable: fields: [name] unique: true builder: ['saInflector', 'urlize'] columns: category_id: { type: integer, notnull: true } name: { type: string(255), notnull: true } code: { type: string(255), notnull: true } price: { type: float, notnull: true, default: 0 } is_active: { type: boolean, notnull: true, default: true } relations: Category: { onDelete: CASCADE, local: category_id, foreign: id, foreignAlias: Products, type: one, foreignType: many } Category: actAs: Timestampable: ~ Sluggable: fields: [name] unique: true builder: ['saInflector', 'urlize'] columns: parent_id: { type: integer, notnull: false } name: { type: string(255), notnull: true } relations: Parent: { class: Category, onDelete: CASCADE, local: parent_id, foreign: id, foreignAlias: Children, type: one, foreignType: many } Address: actAs: Timestampable: ~ columns: user_id: { type: integer, notnull: true } street: { type: string(255), notnull: true } city: { type: string(255), notnull: true } zip: { type: string(255), notnull: true } ic: { type: string(255), notnull: true } dic: { type: string(255), notnull: true } relations: User: { class: sfGuardUser, onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Address, type: one, foreignType: one } Invoice: actAs: Timestampable: ~ columns: user_id: { type: integer } user_name: { type: string(255) } user_email: { type: string(255) } representant_id: { type: integer } representant_name: { type: string(255) } representant_email: { type: string(255) } street: { type: string(255) } city: { type: string(255) } zip: { type: string(255) } ic: { type: string(255) } dic: { type: string(255) } note: { type: string(255) } relations: User: { class: sfGuardUser, onDelete: SET NULL, local: user_id, foreign: id, foreignAlias: Invoices, type: one, foreignType: many } Representant: { class: sfGuardUser, onDelete: SET NULL, local: representant_id, foreign: id, foreignAlias: RepresentantInvoices, type: one, foreignType: many } InvoiceItem: actAs: Timestampable: ~ columns: invoice_id: { type: integer, notnull: true } product_id: { type: integer, notnull: false } code: { type: string(255), notnull: true } name: { type: string(255), notnull: true } amount: { type: integer, notnull: true } price: { type: float, notnull: true } is_gratis: { type: boolean, notnull: true, default: false } relations: Invoice: { onDelete: CASCADE, local: invoice_id, foreign: id, foreignAlias: Items, type: one, foreignType: many } Product: { onDelete: SET NULL, local: product_id, foreign: id, foreignAlias: Items, type: one, foreignType: many } RepresentantUser: columns: user_id: { type: integer, notnull: true } representant_id: { type: integer, notnull: true } relations: User: { class: sfGuardUser, onDelete: CASCADE, local: user_id, foreign: id, foreignAlias: Representants, type: one, foreignType: many } Representant: { class: sfGuardUser, onDelete: CASCADE, local: representant_id, foreign: id, foreignAlias: Users, type: one, foreignType: many }