MOBILE-2386 course: Migrate logs database schema
parent
f11892f93c
commit
3cf70c83f7
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { CoreSitesProvider } from '@providers/sites';
|
import { CoreSitesProvider, CoreSiteSchema } from '@providers/sites';
|
||||||
import { CoreTextUtilsProvider } from '@providers/utils/text';
|
import { CoreTextUtilsProvider } from '@providers/utils/text';
|
||||||
import { CoreTimeUtilsProvider } from '@providers/utils/time';
|
import { CoreTimeUtilsProvider } from '@providers/utils/time';
|
||||||
import { CoreUtilsProvider } from '@providers/utils/utils';
|
import { CoreUtilsProvider } from '@providers/utils/utils';
|
||||||
|
@ -27,7 +27,10 @@ export class CoreCourseLogHelperProvider {
|
||||||
|
|
||||||
// Variables for database.
|
// Variables for database.
|
||||||
static ACTIVITY_LOG_TABLE = 'course_activity_log';
|
static ACTIVITY_LOG_TABLE = 'course_activity_log';
|
||||||
protected tablesSchema = [
|
protected siteSchema: CoreSiteSchema = {
|
||||||
|
name: 'CoreCourseOfflineProvider',
|
||||||
|
version: 1,
|
||||||
|
tables: [
|
||||||
{
|
{
|
||||||
name: CoreCourseLogHelperProvider.ACTIVITY_LOG_TABLE,
|
name: CoreCourseLogHelperProvider.ACTIVITY_LOG_TABLE,
|
||||||
columns: [
|
columns: [
|
||||||
|
@ -54,12 +57,13 @@ export class CoreCourseLogHelperProvider {
|
||||||
],
|
],
|
||||||
primaryKeys: ['component', 'componentid', 'ws', 'time']
|
primaryKeys: ['component', 'componentid', 'ws', 'time']
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
};
|
||||||
|
|
||||||
constructor(protected sitesProvider: CoreSitesProvider, protected timeUtils: CoreTimeUtilsProvider,
|
constructor(protected sitesProvider: CoreSitesProvider, protected timeUtils: CoreTimeUtilsProvider,
|
||||||
protected textUtils: CoreTextUtilsProvider, protected utils: CoreUtilsProvider,
|
protected textUtils: CoreTextUtilsProvider, protected utils: CoreUtilsProvider,
|
||||||
protected appProvider: CoreAppProvider) {
|
protected appProvider: CoreAppProvider) {
|
||||||
this.sitesProvider.createTablesFromSchema(this.tablesSchema);
|
this.sitesProvider.registerSiteSchema(this.siteSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue