symfony1 - Relations created with YAML in Symfony (with Doctrine) are not populated in MySQL database -
I'm new to Symfony, build-sql then try to create a database structure through the build model Doing
All tables are visible in the database, but relationships are not created except for simple one-to-many relationships.
I have for example a table storage companies, they can be both supplier or customer and I have a customer / supplier relationship storage table
identifier :. actAs: [Timestampable] TableName: identifier column: ID: Type: integer (20) fixed false unsigned: false Primary: True autoincrement: true relationships: Suppliers: Class identifier Local: CUSTOMER_ID foreign: Supplier_id RefClass: CustomerSupplier ForeignAlias: Customers onDelete : CASCADE customer: category: identifier local: supplier_id overseas: RefClass CUSTOMER_ID: CustomerSupplier ForeignAlias: supplier onDelete: CASCADE CustomerSupplier: actAs: [Timestampable] Teblnam: customer supporter column: ID: type: integer (20) Tyः wrong Asi Gned: false Q Thamik truth autoincrement: true CUSTOMER_ID: Type: integer (20) fixed false unsigned: false Primary: false Notnull truth Autoincrement: false supplier_id: Type: Fixed integer (20): False unsigned: false Primary: false Notnull truth Autoincrement false you went not created one-to-one relationship either:
IdentifierExtCompany: actAs: [Timestampable] TableName: identifierExtCompany column: Identifier_id: Type: Integer (20) fixed: false unsigned: false primary: true autoincrement: true relations: identifier: local: identifier_id Native: ID onDelete: CASCADE foreignType: a type: he runs a does not appear in the database all these relationships when I requested SQL generated by the build-sql.
Can you help me find out what's wrong in my yaml file? Thanks in advance
For instance, I store a table companies, they can be both suppliers Or customers and I have a more table storage / storage relationship.
Looks like you have to define relationships for CustomerSupplier too. -One-relationships are not created either Try specifying the class attribute in relationships and set it to identifier Please. Hope it helps. / P>
Comments
Post a Comment