|
15 | 15 | // different databases. |
16 | 16 | // TODO: hide all schema logic inside the database adapter. |
17 | 17 | // @flow-disable-next |
18 | | -import Parse from 'parse/node'; |
19 | 18 | import ParseError from '../ParseError'; |
20 | 19 | import { StorageAdapter } from '../Adapters/Storage/StorageAdapter'; |
21 | 20 | import SchemaCache from '../Adapters/Cache/SchemaCache'; |
22 | 21 | import DatabaseController from './DatabaseController'; |
23 | | -import Config from '../Config'; |
24 | 22 | // @flow-disable-next |
25 | 23 | import deepcopy from 'deepcopy'; |
26 | 24 | import type { |
@@ -719,9 +717,8 @@ export default class SchemaController { |
719 | 717 | protectedFields: any; |
720 | 718 | userIdRegEx: RegExp; |
721 | 719 |
|
722 | | - constructor(databaseAdapter: StorageAdapter) { |
| 720 | + constructor(databaseAdapter: StorageAdapter, config) { |
723 | 721 | this._dbAdapter = databaseAdapter; |
724 | | - const config = Config.get(Parse.applicationId); |
725 | 722 | this.schemaData = new SchemaData(SchemaCache.all(), this.protectedFields); |
726 | 723 | this.protectedFields = config.protectedFields; |
727 | 724 |
|
@@ -1490,8 +1487,8 @@ export default class SchemaController { |
1490 | 1487 | } |
1491 | 1488 |
|
1492 | 1489 | // Returns a promise for a new Schema. |
1493 | | -const load = (dbAdapter: StorageAdapter, options: any): Promise<SchemaController> => { |
1494 | | - const schema = new SchemaController(dbAdapter); |
| 1490 | +const load = (dbAdapter: StorageAdapter, config, options: any): Promise<SchemaController> => { |
| 1491 | + const schema = new SchemaController(dbAdapter, config); |
1495 | 1492 | ttl.duration = dbAdapter.schemaCacheTtl; |
1496 | 1493 | return schema.reloadData(options).then(() => schema); |
1497 | 1494 | }; |
|
0 commit comments