Posted By

rccc on 01/13/10


Tagged

yml propel


Versions (?)

schema.yml template


 / Published in: XML
 

URL: http://www.symfony-project.org/blog/2008/11/10/call-the-expert-nested-forms-a-real-implementation

  1. # config/schema.yml
  2. propel:
  3. demo_ad:
  4. id: ~
  5. title: { type: varchar(255), required: true }
  6. description: { type: longvarchar, required: true }
  7. price: float
  8. type: { type: varchar(255), required: true }
  9.  
  10. demo_ad_type_house:
  11. id: ~
  12. demo_ad_id: { type: integer, foreignTable: demo_ad, foreignReference: id, required: true }
  13. square_footage: { type: integer, required: true }
  14. nb_beds: { type: integer, required: true }
  15. nb_baths: { type: integer, required: true }
  16. year: { type: varchar(255), required: true }
  17.  
  18. demo_ad_type_car:
  19. id: ~
  20. demo_ad_id: { type: integer, foreignTable: demo_ad, foreignReference: id, required: true }
  21. make: { type: varchar(255), required: true }
  22. model: { type: varchar(255), required: true }
  23. year: { type: varchar(255), required: true }
  24. color: { type: varchar(255), required: true }
  25.  
  26. #/data/fixtures.yml
  27. DemoAd:
  28. house_1:
  29. title: Farm
  30. description: |
  31. 250 acres with irrigation, several shares of water rights, creek, spring and a well.
  32. price: 2225000
  33. type: house
  34. car_1:
  35. title: Honda Accor
  36. description: |
  37. Honda accord fully loaded, power windows, sun roof, new timing belt, new brakes, a/c , cd player.
  38. price: 6900
  39. type: car
  40.  
  41. DemoAdTypeHouse:
  42. house_1_desc:
  43. demo_ad_id: house_1
  44. square_footage: 4500
  45. nb_beds: 4
  46. nb_baths: 3
  47. year: 1910
  48.  
  49. DemoAdTypeCar:
  50. car_1_desc:
  51. demo_ad_id: car_1
  52. make: honda
  53. model: accor
  54. year: 2002
  55. color: green

Report this snippet  

You need to login to post a comment.