New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 backport: Fixes QueryInterface#changeColumn for enums #7456

Merged
merged 3 commits into from Apr 19, 2017

Conversation

4 participants
@seshness
Contributor

seshness commented Mar 30, 2017

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

This comment has been minimized.

mention-bot commented Mar 30, 2017

@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

This comment has been minimized.

codecov-io commented Mar 30, 2017

Codecov Report

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

@sushantdhiman

This comment has been minimized.

Member

sushantdhiman commented Apr 5, 2017

@seshness Needs a changelog entry

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

seshness added some commits Mar 29, 2017

Backport #7455
Fixes QueryInterface#changeColumn for enums

@seshness seshness force-pushed the seshness:v3-enum-migration-fix branch from ae1cb23 to 4831558 Apr 5, 2017

@sushantdhiman sushantdhiman merged commit 360d621 into sequelize:v3 Apr 19, 2017

4 checks passed

codecov/patch 100% of diff hit (target 94.01%)
Details
codecov/project 94.06% (+0.04%) compared to aa39f96
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

holm added a commit to holm/sequelize that referenced this pull request Nov 13, 2017

V3 backport: Fixes QueryInterface#changeColumn for enums (sequelize#7456
)

* 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