major bug fixes & breaking change in database code
Major bug fixes and improvements have been made. There's also a breaking change for plugins using the database system. All database related functions are now async based.
This commit is contained in:
@@ -87,7 +87,7 @@ interface ODUtilities {
|
||||
*/
|
||||
emojiTitle(emoji:string, text:string): string
|
||||
/**## runAsync `utility function`
|
||||
* Use this function to run a piece of code asyncronous without creating a separate function for it!
|
||||
* Use this function to run a snippet of code asyncronous without creating a separate function for it!
|
||||
*/
|
||||
runAsync(func:() => Promise<void>): void
|
||||
/**## timedAwait `utility function`
|
||||
|
||||
@@ -4,7 +4,7 @@ export const loadVersionMigrationSystem = async () => {
|
||||
//ENTER MIGRATION CONTEXT
|
||||
await preloadMigrationContext()
|
||||
|
||||
const lastVersion = isMigrationRequired()
|
||||
const lastVersion = await isMigrationRequired()
|
||||
openticket.versions.add(lastVersion ? lastVersion : api.ODVersion.fromString("openticket:last-version",openticket.versions.get("openticket:version").toString()))
|
||||
if (lastVersion && !openticket.flags.get("openticket:no-migration").value){
|
||||
//MIGRATION IS REQUIRED
|
||||
@@ -48,8 +48,8 @@ const unloadMigrationContext = async () => {
|
||||
openticket.debug.debug("-- MIGRATION CONTEXT END --")
|
||||
}
|
||||
|
||||
const isMigrationRequired = (): false|api.ODVersion => {
|
||||
const rawVersion = openticket.databases.get("openticket:global").get("openticket:last-version","openticket:version")
|
||||
const isMigrationRequired = async (): Promise<false|api.ODVersion> => {
|
||||
const rawVersion = await openticket.databases.get("openticket:global").get("openticket:last-version","openticket:version")
|
||||
if (!rawVersion) return false
|
||||
const version = api.ODVersion.fromString("openticket:last-version",rawVersion)
|
||||
if (openticket.versions.get("openticket:version").compare(version) == "higher"){
|
||||
|
||||
Reference in New Issue
Block a user