chore: Expose createDatabaseInstance, createMigrationRunner methods

This commit is contained in:
Tom Moor
2023-11-25 13:18:51 -05:00
parent b903be6804
commit a21e1d9fea
6 changed files with 96 additions and 69 deletions

View File

@@ -127,7 +127,12 @@ class Revision extends IdModel {
// instance methods
previous(): Promise<Revision | null> {
/**
* Find the revision for the document before this one.
*
* @returns A Promise that resolves to a Revision, or null if this is the first revision.
*/
before(): Promise<Revision | null> {
return (this.constructor as typeof Revision).findOne({
where: {
documentId: this.documentId,