mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
create version graph to handle migrations (#2708)
* create version graph to handle migrations * Fix some version alpha test * connect dataVersion api * rename init fns * improve types and add tests * set data version after backup restore * chore: Add some types tests for version info * wip: More changes to versionInfo tests * wip: fix my stupid * update mocks * update runtime * chore: Fix the loop --------- Co-authored-by: Jade <2364004+Blu-J@users.noreply.github.com> Co-authored-by: J H <dragondef@gmail.com>
This commit is contained in:
@@ -102,10 +102,7 @@ export namespace ExpectedExports {
|
||||
* Every time a package completes an install, this function is called before the main.
|
||||
* Can be used to do migration like things.
|
||||
*/
|
||||
export type init = (options: {
|
||||
effects: Effects
|
||||
previousVersion: null | string
|
||||
}) => Promise<unknown>
|
||||
export type init = (options: { effects: Effects }) => Promise<unknown>
|
||||
/** This will be ran during any time a package is uninstalled, for example during a update
|
||||
* this will be called.
|
||||
*/
|
||||
@@ -437,6 +434,10 @@ export type Effects = {
|
||||
value: ExtractStore
|
||||
}): Promise<void>
|
||||
}
|
||||
/** sets the version that this service's data has been migrated to */
|
||||
setDataVersion(options: { version: string }): Promise<void>
|
||||
/** returns the version that this service's data has been migrated to */
|
||||
getDataVersion(): Promise<string | null>
|
||||
|
||||
// system
|
||||
|
||||
|
||||
Reference in New Issue
Block a user