Skip to content

Commit

Permalink
fix(database): object comparison failing due to wrong check (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Feb 2, 2023
1 parent ae938c0 commit fb525eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/database/src/adapters/utils/validateSchema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConduitSchema, ConduitError } from '@conduitplatform/grpc-sdk';
import { ConduitError, ConduitSchema } from '@conduitplatform/grpc-sdk';
import { Fields } from '../../interfaces';
import { isString, isArray } from 'lodash';
import { isArray, isEqual, isString } from 'lodash';
import { DataTypes } from 'sequelize';

/*
Expand Down Expand Up @@ -30,7 +30,7 @@ function validateSchemaFields(oldSchemaFields: any, newSchemaFields: any) {
if (isArray(oldType) && isArray(newType)) {
if (JSON.stringify(oldType[0]) !== JSON.stringify(newType[0]))
throw ConduitError.forbidden('Invalid schema types');
} else if (oldType !== newType) {
} else if (!isEqual(oldType, newType)) {
// TODO: Support schema field type migration
throw ConduitError.forbidden('Invalid schema types');
}
Expand Down

0 comments on commit fb525eb

Please sign in to comment.