I'm using Symfony and Doctrine, and have several many-to-many relations that work fine.
But there is a table called "document" that holds documents that can relate to several kind of contents, and has an admin section of it's own.
Whenever I update a Document, every relation it had to the rest of the tables is lost.
I Googled it for a while but couldn't find the reason.
¿Have you ever experienced something like this? ¿What can I do?
This is the schema, but the constraints do not exist in MySQL.
Document:
actAs: [Timestampable]
columns:
title: string(255)
filename: string(255)
owner_id: integer
Productar:
actAs:
Timestampable: ~
I18n:
fields: [title, tagline, intro, body]
columns:
title: string(255)
tagline: clob
intro: clob
body: clob
video: string(255)
header_image: string(255)
small_image: string(255)
relations:
Documents:
class: Document
local: productar_id
foreign: document_id
type: many
refClass: ProductarDocument
onDelete: SET NULL
ProductarDocument:
actAs: [Timestampable]
columns:
productar_id:
type: integer
fixed: false
unsigned: false
primary: true
autoincrement: false
document_id:
type: integer
fixed: false
unsigned: false
primary: true
autoincrement: false
relations:
Productar:
class: Productar
local: productar_id
foreign: id
onDelete: SET NULL # Also tried with CASCADE
Document:
class: Document
local: document_id
foreign: id
onDelete: SET NULL # Also tried with CASCADE