Cześć. Prośba o looka:
@Entity
@Table(name = "QUESTION_DEFINITION")
data class QuestionDefinition(
@Id
@Column(nullable = false, length = 36)
@GeneratedValue(generator = "uuid")
@GenericGenerator(name = "uuid", strategy = "uuid2")
val id: String?,
@Column(nullable = false, length = 1024)
val question: String,
) : Serializable
liquibase:
```
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.6.xsd">
<changeSet author="process" id="2">
<createTable tableName="QUESTION_DEFINITION">
<column computed="false" name="id" type="varchar(36)">
<constraints nullable="false" primaryKey="true" primaryKeyName="PK_213E83FE70C9317"/>
</column>
<column name="question" type="varchar(1024)">
<constraints nullable="false" />
</column>
</createTable>
</changeSet>
<changeSet author="process" id="6">
<insert tableName="QUESTION_DEFINITION">
<column name="question" value="fox"/>
</insert>
</changeSet>
</databaseChangeLog>
```
application.properties:
```
spring.datasource.url=jdbc:postgresql://localhost:5432/aa
spring.datasource.username=postgres
spring.datasource.password=postgres
# Konfiguracja Hibernate
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
spring.datasource.driver-class-name=org.postgresql.Driver
spring.liquibase.change-log=classpath:/liquibase/*.xml
```
Dostaję:
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "id" of relation "question_definition" violates not-null constraint
Detail: Failing row contains (null, fox).
Co robię źle? Dzięki!