在我的应用中,显示器有许多基准测试(1到多个) 在监视器编辑界面中,当我保存修改时,每个具有monitor_id的基准测试我编辑的那个都被删除了!
Monitor:
tableName: monitor
actAs:
Timestampable: ~
columns:
id : {type: integer(4), primary: true, autoincrement: true}
label: {type: string(45)}
url: {type: string(80)}
frequency: {type: integer}
timeout: {type: integer}
method: {type: enum, values: [GET, POST, HEAD, PUT, DELETE]}
parameters: {type: string(255)}
active : { type: boolean, notnull: true, default: 1 }
relations:
GroupsByAlert:
class: sfGuardGroup
local: monitor_id
foreign: sf_guard_group_id
refClass: Alert
foreignAlias: Groups
Accidents:
class: Accident
local: id
foreign: monitor_id
Benchmark:
#detect_relations: true
tableName: benchmark
actAs:
Timestampable: ~
columns:
#id: {type: integer(4), primary: true,autoincrement: true}
monitor_id: { type: integer(4)}
server_id: { type: integer(4)}
connexionTime: {type: string(45)}
executionTime: {type: string(45)}
responseTime: {type: string(45)}
responseCode: {type: string(45)}
responseMessage: {type: string(45)}
responseBody: {type: blob}
relations:
Monitor:
class: Monitor
local: monitor_id
foreign: id
Server:
class: Server
local: server_id
foreign: id
有什么想法吗?
答案 0 :(得分:0)
我找到答案了, 实际上它是我在generator.yml中省略的一个字段而忘了取消设置,hense Doctrine不知道该做什么,而是通过删除每个相关对象并重新创建另一个来开始!