This is a strange one
Take this schema:
Contact:
actAs: [Timestampable,SoftDelete]
columns:
first_name: { type: string(255), notnull: true }
second_name: { type: string(255), notnull: true }
relations:
Forums:
class: Forum
refClass: ContactForum
local: forum_id
foreign: contact_id
foreignAlias: Contacts
ContactForums:
local: id
foreign: contact_id
class: ContactForum
type: many
foreignType: one
cascade: [delete]
Forum:
actAs: [Timestampable,SoftDelete]
columns:
name: { type: string(255), notnull: true }
relations:
ContactForums:
class: ContactForum
local: id
foreign: forum_id
type: many
cascade: [delete]
ContactForum:
actAs: [Timestampable]
columns:
contact_id: { type: integer, primary: true }
forum_id: { type: integer, primary: true }
Then if we associate a couple of Forum
objects to a Contact
object and then try and delete this Contact
object we get this error message:
Integrity constraint violation: 19 contact_forum.created_at may not be NULL
If you add SoftDelete to the link table the delete works correctly, and so does the SoftDelete. However we don't want SoftDelete on the link table as it means our primary keys don't work correctly. Is this a bug?