Skip to content

V3 backport: Fixes QueryInterface#changeColumn for enums#7456

Merged
sushantdhiman merged 3 commits intosequelize:v3from
seshness:v3-enum-migration-fix
Apr 19, 2017
Merged

V3 backport: Fixes QueryInterface#changeColumn for enums#7456
sushantdhiman merged 3 commits intosequelize:v3from
seshness:v3-enum-migration-fix

Conversation

@seshness
Copy link
Copy Markdown
Contributor

Pull Request check-list

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does your issue contain a link to existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Have you added an entry under Future in the changelog?

Description of change

Previous changes to support schemas in QueryInterface generated invalid Postgres SQL when attempting to change a column to an enum value.

Instead of generating

ALTER TABLE "myTable" ALTER COLUMN "col_1" TYPE "public"."enum_myTable_col_1" USING ("col_1"::"public.enum_myTable_col_1");

with this change we will now generate

ALTER TABLE "myTable" ALTER COLUMN "col_1" TYPE "public"."enum_myTable_col_1" USING ("col_1"::"public"."enum_myTable_col_1");

@mention-bot
Copy link
Copy Markdown

@seshness, thanks for your PR! By analyzing the history of the files in this pull request, we identified @overlookmotel, @jonathana and @durango to be potential reviewers.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 30, 2017

Codecov Report

Merging #7456 into v3 will increase coverage by 0.04%.
The diff coverage is 100%.

@sushantdhiman
Copy link
Copy Markdown
Contributor

@seshness Needs a changelog entry

[FIXED] `changeColumn` generates incorrect query with ENUM type [#7456](https://github.com/sequelize/sequelize/pull/7456)

@seshness seshness force-pushed the v3-enum-migration-fix branch from ae1cb23 to 4831558 Compare April 5, 2017 15:23
@sushantdhiman sushantdhiman merged commit 360d621 into sequelize:v3 Apr 19, 2017
holm pushed a commit to holm/sequelize that referenced this pull request Nov 13, 2017
)

* Backport sequelize#7455

Fixes QueryInterface#changeColumn for enums

* Prevent test from running in MSSQL

* Adds a changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants