Skip to content

Commit

Permalink
updates from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveByerly committed Oct 18, 2019
1 parent f67ba15 commit 9050f56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/driver/aurora-data-api/AuroraDataApiQueryRunner.ts
Expand Up @@ -1221,8 +1221,14 @@ export class AuroraDataApiQueryRunner extends BaseQueryRunner implements QueryRu
if (indexTableFullName !== tableFullName) {
return false;
}
// tslint:disable-next-line:triple-equals - trying to find truthy value
return dbIndex["COLUMN_NAME"] === dbColumn["COLUMN_NAME"] && dbIndex["NON_UNIQUE"] == "0";

// Index is not for this column
if (dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]) {
return false;
}

const nonUnique = parseInt(dbIndex["NON_UNIQUE"], 10);
return nonUnique === 0;
});

const tableMetadata = this.connection.entityMetadatas.find(metadata => metadata.tablePath === table.name);
Expand Down
10 changes: 8 additions & 2 deletions src/driver/mysql/MysqlQueryRunner.ts
Expand Up @@ -1270,8 +1270,14 @@ export class MysqlQueryRunner extends BaseQueryRunner implements QueryRunner {
if (indexTableFullName !== tableFullName) {
return false;
}
// tslint:disable-next-line:triple-equals - trying to find truthy value
return dbIndex["COLUMN_NAME"] === dbColumn["COLUMN_NAME"] && dbIndex["NON_UNIQUE"] == "0";

// Index is not for this column
if (dbIndex["COLUMN_NAME"] !== dbColumn["COLUMN_NAME"]) {
return false;
}

const nonUnique = parseInt(dbIndex["NON_UNIQUE"], 10);
return nonUnique === 0;
});

const tableMetadata = this.connection.entityMetadatas.find(metadata => metadata.tablePath === table.name);
Expand Down
2 changes: 1 addition & 1 deletion test/github-issues/2737/issue-2737.ts
Expand Up @@ -3,7 +3,7 @@ import "reflect-metadata";
import {Connection} from "../../../src/connection/Connection";
import {createTestingConnections, closeTestingConnections, reloadTestingDatabases} from "../../utils/test-utils";

describe.only("github issues > #2737 MySQLDriver findChangedColumns (fields: width, precision)", () => {
describe("github issues > #2737 MySQLDriver findChangedColumns (fields: width, precision)", () => {
let connections: Connection[];

before(async () => connections = await createTestingConnections({
Expand Down

0 comments on commit 9050f56

Please sign in to comment.