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

schema_version column version not nullable on Sybase ASE #1387

Closed
chrstnk opened this issue Aug 1, 2016 · 6 comments
Closed

schema_version column version not nullable on Sybase ASE #1387

chrstnk opened this issue Aug 1, 2016 · 6 comments

Comments

@chrstnk
Copy link

@chrstnk chrstnk commented Aug 1, 2016

What version of Flyway are you using?

4.0.3

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

Java API

What database are you using (type & version)?

Sybase ASE 15.0.3

What operating system are you using?

UNIX/LINUX

What did you do?

(Please include the content causing the issue, any relevant configuration settings, and the command you ran)
ran migrate for the first time including repeatable migrations that don't have a version

What did you expect to see?

schema_version contains a record for the repeatable migration with null values for version

What did you see instead?

java.sql.SQLException: Attempt to insert NULL value into column 'version', table '.....dbo.schema_version'; column does not allow nulls. Update fails.

looked at org.flywaydb.core.internal.dbsupport.sybaseASE.createMetaDataTable.sql and found below
CREATE TABLE ${table} (
...,
version VARCHAR(50),
...

Sybase' default is NOT NULL so the column should be defined as nullable.

@ogerardin
Copy link

@ogerardin ogerardin commented Dec 12, 2016

Same with Sybase 12.5

@mturuta
Copy link

@mturuta mturuta commented Dec 17, 2016

Same for Sybase 15.7.
I tried adding a statement to make the schema_version.version nullable and run it through flyway but the migration just hangs the statement never completes.
Is the workaround of making the schema_version.version nullable manually acceptable?
Will it cause issues down the road?

@ogerardin
Copy link

@ogerardin ogerardin commented Dec 17, 2016

@mturuta I did it manually outside of flyway and I have observed no issues.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jan 31, 2017

The table must have been created with a pre-release of Flyway 4.0 as ever since the official release this column has always been nullable.

@axelfontaine axelfontaine removed this from the Flyway 4.1 milestone Jan 31, 2017
@axelfontaine axelfontaine removed the t: bug label Jan 31, 2017
@ogerardin
Copy link

@ogerardin ogerardin commented Jan 31, 2017

No the table was created with the latest 4.0.3
In the Sybase script that creates the table, the column is not declared as NULL or NOT NULL so Sybase defaults to NOT NULL.
I suggest adding "NULL" to the script (whcih I did) so there is no ambiguity.

@axelfontaine axelfontaine reopened this Jan 31, 2017
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Jan 31, 2017
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jan 31, 2017

@ogerardin Thank you very much for clarifying! That was a huge help! I guess I must have overlooked the last line in @chrstnk 's original report (facepalm!)

@axelfontaine axelfontaine added t: bug and removed r: invalid labels Jan 31, 2017
@axelfontaine axelfontaine added this to the Flyway 4.1 milestone Jan 31, 2017
pradheeps pushed a commit to pradheeps/flyway that referenced this issue Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants