Skip to content

Commit

Permalink
fix: do not generate migration for unchanged enum column (#8161) (#8164)
Browse files Browse the repository at this point in the history
  • Loading branch information
coyoteecd committed Nov 4, 2021
1 parent 25271d7 commit 4638dea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/query-runner/BaseQueryRunner.ts
Expand Up @@ -12,6 +12,7 @@ import {ReplicationMode} from "../driver/types/ReplicationMode";
import { TypeORMError } from "../error/TypeORMError";
import { EntityMetadata } from "../metadata/EntityMetadata";
import { TableForeignKey } from "../schema-builder/table/TableForeignKey";
import { OrmUtils } from "../util/OrmUtils";

export abstract class BaseQueryRunner {

Expand Down Expand Up @@ -325,7 +326,7 @@ export abstract class BaseQueryRunner {
// console.log((checkComment && oldColumn.comment !== newColumn.comment));
// console.log(oldColumn.comment, newColumn.comment);
// console.log("enum ---------------");
// console.log(oldColumn.enum !== newColumn.enum);
// console.log(!OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []));
// console.log(oldColumn.enum, newColumn.enum);

return oldColumn.charset !== newColumn.charset
Expand All @@ -340,7 +341,7 @@ export abstract class BaseQueryRunner {
|| oldColumn.onUpdate !== newColumn.onUpdate // MySQL only
|| oldColumn.isNullable !== newColumn.isNullable
|| (checkComment && oldColumn.comment !== newColumn.comment)
|| oldColumn.enum !== newColumn.enum;
|| !OrmUtils.isArraysEqual(oldColumn.enum || [], newColumn.enum || []);
}

/**
Expand Down

0 comments on commit 4638dea

Please sign in to comment.