mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 02:35:23 -04:00
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:
parent
1a22f749be
commit
99dccc0567
5 changed files with 10 additions and 9 deletions
|
@ -16,14 +16,14 @@ export class RevisionsService {
|
|||
this.logger.warn('Using hardcoded data!');
|
||||
return [
|
||||
{
|
||||
id: 'some-uuid',
|
||||
id: 42,
|
||||
updatedAt: new Date(),
|
||||
length: 42,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
getNoteRevision(noteIdOrAlias: string, revisionId: string): RevisionDto {
|
||||
getNoteRevision(noteIdOrAlias: string, revisionId: number): RevisionDto {
|
||||
this.logger.warn('Using hardcoded data!');
|
||||
return {
|
||||
id: revisionId,
|
||||
|
@ -39,6 +39,7 @@ export class RevisionsService {
|
|||
},
|
||||
order: {
|
||||
createdAt: 'DESC',
|
||||
id: 'DESC',
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue