Hibernate пытается вставить NULL если переменная пустая, хотя в базе установлены значения по умолчанию для столбцов с помощью liquibase. Т.е. при сохранении он делает insert в поля created, updated, status со значение null Как решить эту проблему, база Postgresql.
Код на liquibase
<changeSet id="1.0.0" author="alex">
<createTable tableName="users">
<column name="id" type="BIGINT" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="username" type="VARCHAR(100)">
<constraints nullable="false" unique="true"/>
</column>
<column name="email" type="VARCHAR(255)">
<constraints nullable="false" unique="true"/>
</column>
<column name="first_name" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="last_name" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="password" type="VARCHAR(255)">
<constraints nullable="false"/>
</column>
<column name="created" type="TIMESTAMP" defaultValueComputed="CURRENT_TIMESTAMP">
<constraints nullable="false"/>
</column>
<column name="updated" type="TIMESTAMP" defaultValueComputed="CURRENT_TIMESTAMP">
<constraints nullable="false"/>
</column>
<column name="status" type="VARCHAR(25)" defaultValue="ACTIVE">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
Продвижение своими сайтами как стратегия роста и независимости