Skip to content

Commit 4d58b6d

Browse files
committed
Add validation for schemas
1 parent 0822904 commit 4d58b6d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/SchemaMigrations/DefinedSchemas.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,16 @@ export class DefinedSchemas {
120120
c => !localSchemas.includes(c) && !systemClasses.includes(c)
121121
);
122122

123-
if (missingSchemas.length) {
123+
if (new Set(localSchemas).size !== localSchemas.length) {
124+
logger.error(
125+
`The list of schemas provided contains duplicated "className" "${localSchemas.join(
126+
'","'
127+
)}"`
128+
);
129+
process.exit(1);
130+
}
131+
132+
if (this.migrationsOptions.strict && missingSchemas.length) {
124133
logger.warn(
125134
`The following schemas are currently present in the database, but not explicitly defined in a schema: "${missingSchemas.join(
126135
'", "'

0 commit comments

Comments
 (0)