hmans / indiepants

IndiePants, aka Pants Phase 2. A clean indieweb-like implementation.
13 stars 1 forks source link

Refactor how User and Document store URL information #32

Closed hmans closed 9 years ago

hmans commented 9 years ago

A slightly improved scheme for storing user and document data that is somewhat better normalized.

User:

Document:

We can still give Document a #url attribute that automatically assigns the document instance to the correct user (creating one, if necessary; maybe even updating an existing one, in case the user's scheme has changed.)

This would greatly simplify things like #31 (and related), nicely denormalize the database information, and we'd still be able to build full URLs from the information present. The only potential drawback is that we'll need to create User records for every document URL that ends up in the database, but this probably isn't really a big problem.

It would also solve the HTTP vs. HTTPS problem, as moving a user from a HTTP to a HTTPS host would now just be a matter of changing the User record's URL.

Checklist: