fixed replicator for oracle

This commit is contained in:
Jan Prochazka
2025-04-23 15:54:02 +02:00
parent ebcf88070c
commit 5278861ccd
3 changed files with 5 additions and 3 deletions

View File

@@ -300,6 +300,7 @@ describe('Data replicator', () => {
DB1.role_permissions.splice(1, 1); DB1.role_permissions.splice(1, 1);
await dataReplicator(createDuplConfig(DB1)); await dataReplicator(createDuplConfig(DB1));
expect(await queryValue(`select count(*) as ~val from ~role_permissions`)).toEqual('2'); expect(await queryValue(`select count(*) as ~val from ~role_permissions`)).toEqual('2');
}) }),
15 * 1000
); );
}); });

View File

@@ -130,7 +130,8 @@ class ReplicatorItemHolder {
const ref = this.refByColumn[key]; const ref = this.refByColumn[key];
if (ref) { if (ref) {
// remap id // remap id
res[key] = ref.ref.idMap[res[key]]; const oldId = res[key];
res[key] = ref.ref.idMap[oldId];
if (ref.isMandatory && res[key] == null) { if (ref.isMandatory && res[key] == null) {
// mandatory refertence not matched // mandatory refertence not matched
if (this.replicator.options.skipRowsWithUnresolvedRefs) { if (this.replicator.options.skipRowsWithUnresolvedRefs) {

View File

@@ -7,7 +7,7 @@ export function isTypeNumeric(dataType) {
} }
export function isTypeFloat(dataType) { export function isTypeFloat(dataType) {
return dataType && /float|single|double/i.test(dataType); return dataType && /float|single|double|number/i.test(dataType);
} }
export function isTypeNumber(dataType) { export function isTypeNumber(dataType) {