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

LocalTime (TIME) is not handled the same as TIMESTAMP #663

Closed
T00fy opened this issue Feb 29, 2024 · 0 comments
Closed

LocalTime (TIME) is not handled the same as TIMESTAMP #663

T00fy opened this issue Feb 29, 2024 · 0 comments

Comments

@T00fy
Copy link
Contributor

T00fy commented Feb 29, 2024

With Spring boot 3.2.2 and when working with an entity like this

@Entity
public class Entity {
private LocalTime startTime;
}

The creation works as expected:

CREATE TABLE public.entity(start_time time(6) WITHOUT TIME ZONE);

However, when making any subsequent change completely unrelated to the original Entity:

@Entity
public class EntityTwo {
private String foo;
}

Causes this diff:

CREATE TABLE public.entity_two(foo VARCHAR(255);
ALTER TABLE public.entity ALTER COLUMN startTime TYPE time WITHOUT TIME ZONE USING (startTime::time WITHOUT TIME ZONE);

Any subsequent diff always contains this alter table statement, even if there is no diff:

ALTER TABLE public.entity ALTER COLUMN startTime TYPE time WITHOUT TIME ZONE USING (startTime::time WITHOUT TIME ZONE);

When running the underlying liquibase diff, we can see:

[2024-02-29 10:40:45] INFO [liquibase.ext] Found column start_time time(6)
     HIBERNATE.opening_hours.start_time
          certainDataType changed from 'false' to 'null'
          order changed from 'null' to '3'
          type changed from 'time(6)' to 'time(15, 6)'

It seems that this type needs to be handled the same as TIMESTAMP.

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

1 participant