1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
| # config/doctrine/schema.yml
Article:
tableName: article
columns:
titre: { type: string(255), notnull: true }
url: { type: string(255), notnull: true, unique: true }
meta_desc: { type: string(255)}
intro: { type: clob, notnull: true }
texte: { type: clob, notnull: true }
etat: { type: integer(1), notnull: true}
relations:
Categories:
class: Categorie
refClass: CategorieArticle
foreignAlias: Articles
Categorie:
tableName: categorie
columns:
nom: { type: string(255), notnull: true }
url: { type: string(255), notnull: true, unique: true }
relations:
CategoriesMeres:
class: Categorie
refClass: CategorieCategorie
foreignAlias: Categories
local: categorie_id
foreign: categorie_mere_id
CategorieArticle:
tableName: categorie_article
columns:
categorie_id: { type: integer, primary: true, notnull: true }
article_id: { type: integer, primary: true, notnull: true }
position: {type: integer, notnull: true }
relations:
Categorie: { onDelete: CASCADE, local: categorie_id, foreign: id }
Article: { onDelete: CASCADE, local: article_id, foreign: id }
CategorieCategorie:
tableName: categorie_categorie
columns:
categorie_id: { type: integer, primary: true, notnull: true }
categorie_mere_id: { type: integer, primary: true, notnull: true }
position: {type: integer, notnull: true } |
Partager