From 08b0b4e30f0bb5d7ad0da97b9279fc6bd03081e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 22 Mar 2021 12:29:52 +0100 Subject: [PATCH] MOBILE-3651 question: Install question db tables --- src/core/features/features.module.ts | 2 ++ src/core/features/question/question.module.ts | 13 +++++++++---- .../features/question/services/database/question.ts | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/features/features.module.ts b/src/core/features/features.module.ts index adbc3c687..cdece3e09 100644 --- a/src/core/features/features.module.ts +++ b/src/core/features/features.module.ts @@ -34,6 +34,7 @@ import { CoreCommentsModule } from './comments/comments.module'; import { CoreSitePluginsModule } from './siteplugins/siteplugins.module'; import { CoreRatingModule } from './rating/rating.module'; import { CoreSharedFilesModule } from './sharedfiles/sharedfiles.module'; +import { CoreQuestionModule } from './question/question.module'; @NgModule({ imports: [ @@ -57,6 +58,7 @@ import { CoreSharedFilesModule } from './sharedfiles/sharedfiles.module'; CoreSitePluginsModule, CoreRatingModule, CoreSharedFilesModule, + CoreQuestionModule, ], }) export class CoreFeaturesModule {} diff --git a/src/core/features/question/question.module.ts b/src/core/features/question/question.module.ts index 321fe2106..6ec2601d5 100644 --- a/src/core/features/question/question.module.ts +++ b/src/core/features/question/question.module.ts @@ -13,7 +13,9 @@ // limitations under the License. import { NgModule, Type } from '@angular/core'; +import { CORE_SITE_SCHEMAS } from '@services/sites'; import { CoreQuestionBehaviourDelegateService } from './services/behaviour-delegate'; +import { QUESTION_SITE_SCHEMA } from './services/database/question'; import { CoreQuestionProvider } from './services/question'; import { CoreQuestionDelegateService } from './services/question-delegate'; import { CoreQuestionHelperProvider } from './services/question-helper'; @@ -26,9 +28,12 @@ export const CORE_QUESTION_SERVICES: Type[] = [ ]; @NgModule({ - declarations: [], - imports: [], - providers: [], - exports: [], + providers: [ + { + provide: CORE_SITE_SCHEMAS, + useValue: [QUESTION_SITE_SCHEMA], + multi: true, + }, + ], }) export class CoreQuestionModule {} diff --git a/src/core/features/question/services/database/question.ts b/src/core/features/question/services/database/question.ts index 848082132..f43a7991e 100644 --- a/src/core/features/question/services/database/question.ts +++ b/src/core/features/question/services/database/question.ts @@ -19,7 +19,7 @@ import { CoreSiteSchema } from '@services/sites'; */ export const QUESTION_TABLE_NAME = 'questions'; export const QUESTION_ANSWERS_TABLE_NAME = 'question_answers'; -export const SITE_SCHEMA: CoreSiteSchema = { +export const QUESTION_SITE_SCHEMA: CoreSiteSchema = { name: 'CoreQuestionProvider', version: 1, tables: [