The **nullable** and **defaultValue** and **value** attributes do not work together as one
See original GitHub issueEnvironment
Liquibase Version: 4.6.2-4.8.0 Liquibase Integration & Version: Spring Boot 2.6.4 Database Vendor & Version: MySQL 8.0.20 Operating System Type & Version: macOS 12.3
Description
After upgrading 4.6.1->4.6.2+, Using the createTable tag, The nullable and defaultValue attributes do not work.
databaseChangeLog
<changeSet author="tom" id="20220124-003">
<createTable tableName="menu">
<column autoIncrement="true" name="id" type="BIGINT" remarks="pk">
<constraints nullable="false" primaryKey="true"/>
</column>
<column name="path" type="VARCHAR(255)" remarks="path" defaultValue="">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
Liquibase 4.6.1 creates a correct table
`path` varchar(255) NOT NULL DEFAULT '' COMMENT 'path',
Liquibase 4.6.2+ creates a incorrect table
`path` varchar(255) DEFAULT NULL COMMENT 'path',
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
c# - DefaultValue attribute is not working with my Auto Property
The DefaultValue attribute is only used to tell the Visual Studio Designers (for example when designing a form) what the default value of...
Read more >Adding a column with a default value to a table - Ask TOM
I have done very light test adding the column with the default value and not null constraint straight, as opposing of doing it...
Read more >Function arguments - Manual - PHP
A function may define default values for arguments using syntax similar to assigning a variable. The default is used only when the parameter...
Read more >Model Binding in ASP.NET Core | Microsoft Learn
By default, a model state error isn't created if no value is found for a model property. The property is set to null...
Read more >Immutable objects
Any annotation with simple name Nullable will work. Nullable attributes are not required to be set using a builder, and null values are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please see https://github.com/liquibase/liquibase/issues/2657. The problem exists only for adding non-nullable columns when the
value
is also specified. If the value is not specified, default value is correctly set.This is working for me as of 4.13.0. I think it was addressed by #2752