known icon indicating copy to clipboard operation
known copied to clipboard

Datamodel: Annotations are stored wrong

Open mapkyca opened this issue 6 years ago • 2 comments

While trying to do this:

List, edit, delete or otherwise manage annotations and comments

I encountered this error:

It's not really possible, as annotations are stored directly on the object

Some other notes:

The current data model is very heavily influenced by the fact it was originally stored in mongo only. Storing annotations on the actual object is utterly crazy when you're in a relational world.

Redesign the data model to store annotations in its own table.

  • [ ] Annotations to have its own relational table
  • [ ] Object methods to address this for SQL stores
  • [ ] Migration script for existing annotations

Give us some context:

  • It'd also be really handy if you could tell us the contents of your version.known file
  • What database are you using? (e.g. mongo, mysql, postgres)
  • Any warnings or errors in your admin/diagnostics page?
  • If this is a programming bug, can you include examples of any Micropub / API calls / webhook pings you make? Otherwise please don't worry about what this means!
  • Bonus points - are you able to illustrate the issue with a unit test? If so, submit it as a pull request!

mapkyca avatar Jun 16 '19 09:06 mapkyca

Storing annotations on the actual object...

I'm encountering this very issue while trying to fetch individual reply annotations, the whole object is returned... #3186

mediaformat avatar Feb 07 '24 22:02 mediaformat

While we are refactoring relations between tables, I would also make annotations have a relation to their (remote) user entity.

This will ensure remote user info such as owner_name & owner_image are always current, for example.

mediaformat avatar Mar 17 '24 18:03 mediaformat