当我用学说导出我的数据库时:数据转储,我遇到了两个问题: * 没有导出主键 * 代替外键列的正确名称,它使用外部表的名称。
例如,这是我的表:
# schema.yml
Planet:
connection: doctrine
tableName: planet
columns:
planet_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
sequence: planet_planet_id
solarsystem_id:
type: integer(4)
fixed: false
unsigned: false
notnull: false
primary: false
# some columns...
relations:
Solarsystem:
local: solarsystem_id
foreign: solarsystem_id
type: one
# other relations...
Solarsystem:
connection: doctrine
tableName: solarsystem
columns:
solarsystem_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
sequence: solarsystem_solarsystem_id
# other columns...
relations:
Planet:
local: solarsystem_id
foreign: solarsystem_id
type: many
# other relations
当我转储时,我会在 data.yml 中找到类似的内容:
Planet_1:
Solarsystem: _1
当我加载数据时,它不起作用(指定的行键无效:(solarsystem)_1,在(行星)Planet_1 中引用)。我必须像这样手动修复:
Planet_1:
solarsystem_id: 1
planet_id: 1
目前,我正在手动修复 data.yml,但是我积累的所有记录开始变得很痛苦......
注意:我使用的是 Symfony 1.4、Doctrine、postgreSQL、NetBeans、Windows。随意询问您认为有用的信息。
谢谢你的帮助