MOBILE-3320 sites: Fix schema name registration

main
Noel De Martin 2021-02-01 13:32:28 +01:00
parent 95ebb00703
commit f2f8ae664d
4 changed files with 7 additions and 21 deletions

View File

@ -1087,7 +1087,7 @@ export class SQLiteDB {
} }
export type SQLiteDBRecordValues = { export type SQLiteDBRecordValues = {
[key in string ]: SQLiteDBRecordValue | undefined | null; [key: string]: SQLiteDBRecordValue | undefined | null;
}; };
export type SQLiteDBQueryParams = { export type SQLiteDBQueryParams = {

View File

@ -17,13 +17,7 @@ import { APP_INITIALIZER, NgModule } from '@angular/core';
import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate';
import { CORE_SITE_SCHEMAS } from '@services/sites'; import { CORE_SITE_SCHEMAS } from '@services/sites';
import { CoreH5PComponentsModule } from './components/components.module'; import { CoreH5PComponentsModule } from './components/components.module';
import { import { SITE_SCHEMA } from './services/database/h5p';
CONTENT_TABLE_NAME,
LIBRARIES_TABLE_NAME,
LIBRARY_DEPENDENCIES_TABLE_NAME,
CONTENTS_LIBRARIES_TABLE_NAME,
LIBRARIES_CACHEDASSETS_TABLE_NAME,
} from './services/database/h5p';
import { CoreH5PPluginFileHandler } from './services/handlers/pluginfile'; import { CoreH5PPluginFileHandler } from './services/handlers/pluginfile';
@NgModule({ @NgModule({
@ -33,13 +27,7 @@ import { CoreH5PPluginFileHandler } from './services/handlers/pluginfile';
providers: [ providers: [
{ {
provide: CORE_SITE_SCHEMAS, provide: CORE_SITE_SCHEMAS,
useValue: [ useValue: [SITE_SCHEMA],
CONTENT_TABLE_NAME,
LIBRARIES_TABLE_NAME,
LIBRARY_DEPENDENCIES_TABLE_NAME,
CONTENTS_LIBRARIES_TABLE_NAME,
LIBRARIES_CACHEDASSETS_TABLE_NAME,
],
multi: true, multi: true,
}, },
{ {

View File

@ -15,16 +15,14 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CORE_SITE_SCHEMAS } from '@services/sites'; import { CORE_SITE_SCHEMAS } from '@services/sites';
import { STATEMENTS_TABLE_NAME } from './services/database/xapi'; import { SITE_SCHEMA } from './services/database/xapi';
@NgModule({ @NgModule({
imports: [], imports: [],
providers: [ providers: [
{ {
provide: CORE_SITE_SCHEMAS, provide: CORE_SITE_SCHEMAS,
useValue: [ useValue: [SITE_SCHEMA],
STATEMENTS_TABLE_NAME,
],
multi: true, multi: true,
}, },
], ],

View File

@ -51,7 +51,7 @@ import {
import { CoreArray } from '../singletons/array'; import { CoreArray } from '../singletons/array';
import { CoreNetworkError } from '@classes/errors/network-error'; import { CoreNetworkError } from '@classes/errors/network-error';
export const CORE_SITE_SCHEMAS = new InjectionToken('CORE_SITE_SCHEMAS'); export const CORE_SITE_SCHEMAS = new InjectionToken<CoreSiteSchema[]>('CORE_SITE_SCHEMAS');
/* /*
* Service to manage and interact with sites. * Service to manage and interact with sites.
@ -1576,7 +1576,7 @@ export class CoreSitesProvider {
} }
// Set installed version. // Set installed version.
await db.insertRecord(SCHEMA_VERSIONS_TABLE_NAME, { name, version: schema.version }); await db.insertRecord(SCHEMA_VERSIONS_TABLE_NAME, { name: schema.name, version: schema.version });
} }
/** /**