# Bug in modifyColumn

**URL:** <https://forum.liquibase.org/t/bug-in-modifycolumn/193>\
**Category:** General Discussion\
**Created:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193 "2009-08-11T16:12:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![justx2](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@justx2](https://forum.liquibase.org/u/justx2)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/1 "2009-08-11T16:12:00Z")

</div>

When using Liquibase to alter a column from nullable to not nullable I get an error.

The Liquibase xml is this:

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

Liquibase gives me this SQL:

ALTER TABLE [ParameterGroupReference] ALTER COLUMN PersistentEntityMetaDataID gtSmallIntID;

but I expected this SQL:

alter table ParameterGroupReference alter column PersistentEntityMetaDataID gtSmallIntID not null;

It seems as if Liquibase forgets about the constraints tag.

Problem occurs in both v 1.9.3 and v 1.9.4.  
My dbms is MSSQL2K5

---

<div class="post-metadata">

**Author:** ![bawolfe](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@bawolfe](https://forum.liquibase.org/u/bawolfe)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/2 "2009-08-11T16:12:00Z")

</div>

This was patched for 1.9.5: [http://liquibase.jira.com/browse/CORE-403](http://liquibase.jira.com/browse/CORE-403)

---

<div class="post-metadata">

**Author:** ![justx2](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@justx2](https://forum.liquibase.org/u/justx2)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/3 "2009-08-11T16:12:00Z")

</div>

> _Originally posted by: bawolfe_  
> This was patched for 1.9.5: [http://liquibase.jira.com/browse/CORE-403](http://liquibase.jira.com/browse/CORE-403)

Awesome!  
Somebody that knows how to use the attached .patch file?  
It’s not a .class or .jar file (rather a kind of change-journal file), so I cant just put it in the classpath as often used for patching.

---

<div class="post-metadata">

**Author:** ![bawolfe](https://avatars.discourse-cdn.com/v4/letter/b/e47c2d/32.png) [@bawolfe](https://forum.liquibase.org/u/bawolfe)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/4 "2009-08-11T16:12:00Z")

</div>

You have to do an svn checkout of the liquibase code, apply the patch to that code, then run the ant ‘package’ task to compile the jar file.&nbsp; I don’t know if there is a nightly build of liquibase jar somewhere that you could use.&nbsp; If there isn’t, you could download the patched 1.9.4 jar that we use in openmrs: [http://dev.openmrs.org/browser/openmrs/trunk/lib/liquibase](http://dev.openmrs.org/browser/openmrs/trunk/lib/liquibase)

---

<div class="post-metadata">

**Author:** ![justx2](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@justx2](https://forum.liquibase.org/u/justx2)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/5 "2009-08-11T16:12:00Z")

</div>

Great!  
Downloaded the one you have and it works - thanks.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [August 11, 2009, 4:12pm UTC](https://forum.liquibase.org/t/bug-in-modifycolumn/193/6 "2009-08-11T16:12:00Z")

</div>

Glad you got it.&nbsp; Thanks for the snapshot and patch brawolfe.&nbsp; I’ll get it applied soon.

Nathan
