Monday, September 14, 2009

Remove 'NOT NULL' constraint in MySQL

Perhaps the title is a misnomer... The 'NOT NULL' limitation on a MySQL table apparently does not count as a constraint. But anyway...

How is it removed? The Quota column of the TODB people table was originally designed not to allow a null value. This has been annoying me until I finally cracked and removed it. This is how:

alter table people_2009_10 modify column quota int(11) null;

I've written it here to help me remember...