2 Commits

Author SHA1 Message Date
github-actions[bot]
c1c326aa5d chore(release): bump version to v0.0.9 and update changelog [skip ci] 2026-02-22 12:03:26 +00:00
almazlar
c26ee4f400 feat: add createdAt field to Todo entity and update database migration script
All checks were successful
Release and Build Docker Images / release-and-build (push) Successful in 1m45s
2026-02-22 15:03:11 +03:00
5 changed files with 52 additions and 15 deletions

View File

@@ -1,3 +1,7 @@
## [v0.0.9] - 2026-02-22
* feat: add createdAt field to Todo entity and update database migration script (c26ee4f)
## [v0.0.8] - 2026-02-22 ## [v0.0.8] - 2026-02-22
* fix: update Dockerfile, application properties, and controller mappings for health check and CORS support (386f513) * fix: update Dockerfile, application properties, and controller mappings for health check and CORS support (386f513)

View File

@@ -1,30 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>4.0.3</version> <version>4.0.3</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>com.example</groupId> <groupId>com.example</groupId>
<artifactId>backend</artifactId> <artifactId>backend</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>backend</name> <name>backend</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<url/> <url />
<licenses> <licenses>
<license/> <license />
</licenses> </licenses>
<developers> <developers>
<developer/> <developer />
</developers> </developers>
<scm> <scm>
<connection/> <connection />
<developerConnection/> <developerConnection />
<tag/> <tag />
<url/> <url />
</scm> </scm>
<properties> <properties>
<java.version>25</java.version> <java.version>25</java.version>
@@ -68,9 +69,20 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId> <artifactId>spring-boot-starter-actuator</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-flyway</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@@ -80,4 +92,4 @@
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@@ -1,5 +1,7 @@
package com.todo.backend.model; package com.todo.backend.model;
import java.time.LocalDateTime;
import jakarta.persistence.*; import jakarta.persistence.*;
@Entity @Entity
@@ -19,6 +21,9 @@ public class Todo {
@Column(nullable = false) @Column(nullable = false)
private boolean completed = false; private boolean completed = false;
@Column(nullable = false, updatable = false)
private LocalDateTime createdAt = LocalDateTime.now();
// Default constructor is required by JPA // Default constructor is required by JPA
public Todo() { public Todo() {
} }
@@ -62,4 +67,9 @@ public class Todo {
public void setCompleted(boolean completed) { public void setCompleted(boolean completed) {
this.completed = completed; this.completed = completed;
} }
public LocalDateTime getCreatedAt() {
return createdAt;
}
} }

View File

@@ -1,10 +1,14 @@
# backend/src/main/resources/application.properties
server.port=8082 server.port=8082
server.servlet.context-path=/api server.servlet.context-path=/api
spring.application.name=backend spring.application.name=backend
spring.jpa.hibernate.ddl-auto=update # Flyway
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration
spring.flyway.baseline-on-migrate=true
# Database
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
management.endpoints.web.exposure.include=health,info,metrics management.endpoints.web.exposure.include=health,info,metrics

View File

@@ -0,0 +1,7 @@
CREATE TABLE todos (
id BIGSERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
completed BOOLEAN NOT NULL DEFAULT FALSE,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);