Skip to content
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

Redshift - Support for ALTER TABLE ALTER COLUMN #2438

Closed
anjo-swe opened this issue Jul 10, 2019 · 3 comments
Closed

Redshift - Support for ALTER TABLE ALTER COLUMN #2438

anjo-swe opened this issue Jul 10, 2019 · 3 comments

Comments

@anjo-swe
Copy link

Which version and edition of Flyway are you using?

5.2.4

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command line

Which database are you using (type & version)?

Redshift

Which operating system are you using?

Linux

What did you do?

Ran a migration to update a table inside Redshift

ALTER TABLE lorem.my_table_name ALTER COLUMN type type varchar(30); 
What did you expect to see?
  • Table should be altered
  • Statement shouldn't be executed inside a transaction
What did you see instead?
ERROR: ALTER TABLE ALTER COLUMN cannot run inside a transaction block
References

https://docs.aws.amazon.com/redshift/latest/dg/r_ALTER_TABLE.html

ALTER COLUMN column_name TYPE new_data_type
...

  • You can't alter columns inside a multi-statement block (BEGIN...END).

https://github.com/flyway/flyway/blob/master/flyway-core/src/main/java/org/flywaydb/core/internal/database/redshift/RedshiftParser.java#L45

  • Need to check for ALTER TABLE ALTER COLUMN as well

Related to: #1879

@MikielAgutu
Copy link

Thanks for the bug report, this is fixed and will be released in v6.

@ajayl-tubi
Copy link

@anjo-swe Thanks for the fix! @MikielAgutu When is the v6 planned to release? As our team needs this fix soon.

@radifalco
Copy link

I'm still seeing this. I get this error in a migration file.

[Amazon](500310) Invalid operation: ALTER TABLE ALTER COLUMN cannot run inside a transaction block;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants