MOBILE-3651 question: Install question db tables

main
Pau Ferrer Ocaña 2021-03-22 12:29:52 +01:00
parent 6134704fb2
commit 08b0b4e30f
3 changed files with 12 additions and 5 deletions

View File

@ -34,6 +34,7 @@ import { CoreCommentsModule } from './comments/comments.module';
import { CoreSitePluginsModule } from './siteplugins/siteplugins.module'; import { CoreSitePluginsModule } from './siteplugins/siteplugins.module';
import { CoreRatingModule } from './rating/rating.module'; import { CoreRatingModule } from './rating/rating.module';
import { CoreSharedFilesModule } from './sharedfiles/sharedfiles.module'; import { CoreSharedFilesModule } from './sharedfiles/sharedfiles.module';
import { CoreQuestionModule } from './question/question.module';
@NgModule({ @NgModule({
imports: [ imports: [
@ -57,6 +58,7 @@ import { CoreSharedFilesModule } from './sharedfiles/sharedfiles.module';
CoreSitePluginsModule, CoreSitePluginsModule,
CoreRatingModule, CoreRatingModule,
CoreSharedFilesModule, CoreSharedFilesModule,
CoreQuestionModule,
], ],
}) })
export class CoreFeaturesModule {} export class CoreFeaturesModule {}

View File

@ -13,7 +13,9 @@
// limitations under the License. // limitations under the License.
import { NgModule, Type } from '@angular/core'; import { NgModule, Type } from '@angular/core';
import { CORE_SITE_SCHEMAS } from '@services/sites';
import { CoreQuestionBehaviourDelegateService } from './services/behaviour-delegate'; import { CoreQuestionBehaviourDelegateService } from './services/behaviour-delegate';
import { QUESTION_SITE_SCHEMA } from './services/database/question';
import { CoreQuestionProvider } from './services/question'; import { CoreQuestionProvider } from './services/question';
import { CoreQuestionDelegateService } from './services/question-delegate'; import { CoreQuestionDelegateService } from './services/question-delegate';
import { CoreQuestionHelperProvider } from './services/question-helper'; import { CoreQuestionHelperProvider } from './services/question-helper';
@ -26,9 +28,12 @@ export const CORE_QUESTION_SERVICES: Type<unknown>[] = [
]; ];
@NgModule({ @NgModule({
declarations: [], providers: [
imports: [], {
providers: [], provide: CORE_SITE_SCHEMAS,
exports: [], useValue: [QUESTION_SITE_SCHEMA],
multi: true,
},
],
}) })
export class CoreQuestionModule {} export class CoreQuestionModule {}

View File

@ -19,7 +19,7 @@ import { CoreSiteSchema } from '@services/sites';
*/ */
export const QUESTION_TABLE_NAME = 'questions'; export const QUESTION_TABLE_NAME = 'questions';
export const QUESTION_ANSWERS_TABLE_NAME = 'question_answers'; export const QUESTION_ANSWERS_TABLE_NAME = 'question_answers';
export const SITE_SCHEMA: CoreSiteSchema = { export const QUESTION_SITE_SCHEMA: CoreSiteSchema = {
name: 'CoreQuestionProvider', name: 'CoreQuestionProvider',
version: 1, version: 1,
tables: [ tables: [