Skip to content

Commit f616ef9

Browse files
committed
Merge branch 'pr-migrations'
2 parents 47b016a + 97b57de commit f616ef9

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

src/SchemaMigrations/DefinedSchemas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as Migrations from './Migrations';
1010

1111
export class DefinedSchemas {
1212
config: ParseServerOptions;
13-
migrationOptions: Migrations.MigrationsOptions;
13+
migrationsOptions: Migrations.MigrationsOptions;
1414
localSchemas: Migrations.JSONSchema[];
1515
retries: number;
1616
maxRetries: number;

src/SchemaMigrations/Migrations.js

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,28 +90,12 @@ export class CLPHelper {
9090
}
9191

9292
export function makeSchema(className: ClassNameType, schema: JSONSchema): JSONSchema {
93+
// This function solve two things:
94+
// 1. It provide auto-completion to the users who are implementing schemas
95+
// 2. It allow forward-compatible point in order to allow future changes to the internal structure of JSONSchema without affecting all the users
96+
9397
return {
9498
className,
95-
fields: {
96-
...schema.fields,
97-
},
98-
indexes: {
99-
...schema.indexes,
100-
},
101-
classLevelPermissions: {
102-
find: {},
103-
count: {},
104-
get: {},
105-
update: {},
106-
create: {},
107-
delete: {},
108-
addField: {},
109-
protectedFields: {
110-
// '*': [
111-
// 'symbol',
112-
// ],
113-
},
114-
...schema.classLevelPermissions,
115-
},
99+
...schema,
116100
};
117101
}

0 commit comments

Comments
 (0)