丰富了initialize时候对现有数据的处理
This commit is contained in:
parent
2014dbd91b
commit
7f14dba278
|
|
@ -35,7 +35,7 @@ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt exten
|
|||
result: any;
|
||||
message?: string;
|
||||
}>;
|
||||
initialize(): Promise<void>;
|
||||
initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic'): Promise<void>;
|
||||
getStore(): DbStore<ED, Cxt>;
|
||||
getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<{
|
||||
headers?: Record<string, string | string[]> | undefined;
|
||||
|
|
|
|||
|
|
@ -185,8 +185,8 @@ class AppLoader extends types_1.AppLoader {
|
|||
throw err;
|
||||
}
|
||||
}
|
||||
async initialize() {
|
||||
await this.dbStore.initialize({ ifExists: 'dropIfNotStatic' });
|
||||
async initialize(ifExists) {
|
||||
await this.dbStore.initialize({ ifExists });
|
||||
const data = this.requireSth('lib/data/index');
|
||||
// oak-domain中只有i18n
|
||||
(0, assert_1.default)(data.i18n);
|
||||
|
|
|
|||
|
|
@ -235,8 +235,8 @@ export class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends Backe
|
|||
}
|
||||
}
|
||||
|
||||
async initialize() {
|
||||
await this.dbStore.initialize({ ifExists: 'dropIfNotStatic' });
|
||||
async initialize(ifExists?: 'drop' | 'omit' | 'dropIfNotStatic') {
|
||||
await this.dbStore.initialize({ ifExists });
|
||||
|
||||
const data = this.requireSth('lib/data/index')!;
|
||||
// oak-domain中只有i18n
|
||||
|
|
|
|||
Loading…
Reference in New Issue