2012-03-15 60 views
0

我有一个已经到位了大规模的架构一个MySQL数据库中,用于MySQL工作台的一个插件结构导出到.yml文件Doctrine2Doctrine2 +笨2数据库映射

出口YML文件的

例子:

twitter: 
     columns: 
     TwitterId: 
      type: integer(4) 
      primary: true 
      notnull: true 
     UserId: 
      type: integer(4) 
      notnull: true 
     relations: 
     User: 
      class: user 
      local: UserId 
      foreign: UserId 
      foreignAlias: twitters 
     indexes: 
     FK_Twitter_User: 
      fields: [UserId] 

我使用Doctrine2 CLI并想知道如何使用Doctrine2来映射和自动生成模型和实体等?

回答

0

我想通了!我跑

php doctrine-cli.php orm:convert-mapping --from-database yml /(your destination folder)/ 

它已经到位DB模式基于我的自动生成的实体类