RevisionEntity: Change primary key type from UUID to number

The precision of sqlites datetime() timestamp is only one second (see https://www.sqlite.org/lang_datefunc.html). Therefore we could not order revisions of one note that were created in the same second. To remedy this, the primary key was changed to a monotonically increasing number, which solves the ordering problem.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-22 20:06:16 +02:00
parent 1a22f749be
commit 99dccc0567
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
5 changed files with 10 additions and 9 deletions

View file

@ -58,7 +58,7 @@ entity "Session" as seesion {
entity "Revision" {
*id : uuid <<generated>>
*id : number <<generated>>
--
*noteId : uuid <<FK Note>>
*content : text
@ -78,7 +78,7 @@ entity "Authorship" {
}
entity "RevisionAuthorship" {
*revisionId : uuid <<FK Revision>>
*revisionId : number <<FK Revision>>
*authorshipId : uuid <<FK Authorship>>
}