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

Create table converts boolean into varchar #52

Open
vicenrico opened this issue Mar 24, 2021 · 3 comments
Open

Create table converts boolean into varchar #52

vicenrico opened this issue Mar 24, 2021 · 3 comments

Comments

@vicenrico
Copy link

Hello, i get this problem in h2 database. When i use boolean field, It converts It to varchar. How can that be possible.?

I,.e. boolean SEEN
When i look generated table, i see it's varchar

Thanks in avance.

@ccleve
Copy link
Member

ccleve commented Mar 24, 2021

I'm not sure -- haven't tested H2 in a while. But I've started to get away from using createTable() in my own code. It's better to just use straight sql: db.sql("CREATE TABLE foo (col1 boolean, col2 varchar)").execute();

@lululombard
Copy link

Just encountered this issue too

@lululombard
Copy link

This condition seems to be flipped, or is it me?

if (columnAnnot.columnDefinition() == null) {

If it wasn't, @Column(name = "my_bool_field", columnDefinition = "my_bool_field tinyint default 0") would probably work.

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

No branches or pull requests

3 participants