Skip to main content
deleted 1 character in body
Source Link
Doc Brown
  • 214.1k
  • 34
  • 394
  • 603

This is a little bitebit hard to answer without knowing more about your CMS, but when I got this right, a `pageNode" should be able to store a list of foreign key references to all kind of "referenced things"?

If that's right, you might introduce an entity "GenericReference", with attributes

  • pageNodeID
  • ID // string
  • typeFlag // indicates if ID is ProductId, CategoryId or BlogId

The drawback is that you loose referential integrity support from the database that way - when you delete a product, category or blog entity, referencing page nodes will not automatically get updated. If that's acceptable or an issue is something you have to decide for yourself..

This is a little bite hard to answer without knowing more about your CMS, but when I got this right, a `pageNode" should be able to store a list of foreign key references to all kind of "referenced things"?

If that's right, you might introduce an entity "GenericReference", with attributes

  • pageNodeID
  • ID // string
  • typeFlag // indicates if ID is ProductId, CategoryId or BlogId

The drawback is that you loose referential integrity support from the database that way - when you delete a product, category or blog entity, referencing page nodes will not automatically get updated. If that's acceptable or an issue is something you have to decide for yourself..

This is a little bit hard to answer without knowing more about your CMS, but when I got this right, a `pageNode" should be able to store a list of foreign key references to all kind of "referenced things"?

If that's right, you might introduce an entity "GenericReference", with attributes

  • pageNodeID
  • ID // string
  • typeFlag // indicates if ID is ProductId, CategoryId or BlogId

The drawback is that you loose referential integrity support from the database that way - when you delete a product, category or blog entity, referencing page nodes will not automatically get updated. If that's acceptable or an issue is something you have to decide for yourself..

Source Link
Doc Brown
  • 214.1k
  • 34
  • 394
  • 603

This is a little bite hard to answer without knowing more about your CMS, but when I got this right, a `pageNode" should be able to store a list of foreign key references to all kind of "referenced things"?

If that's right, you might introduce an entity "GenericReference", with attributes

  • pageNodeID
  • ID // string
  • typeFlag // indicates if ID is ProductId, CategoryId or BlogId

The drawback is that you loose referential integrity support from the database that way - when you delete a product, category or blog entity, referencing page nodes will not automatically get updated. If that's acceptable or an issue is something you have to decide for yourself..