Unable to modify column in MySQL table : <p>I have a requirement wherein I need to change the table structure as per the production environment on a lower environment. The table has a multi-column <strong>PRIMARY KEY as  (<code>md_biobjectid</code>,<code>projectid</code>,<code>md_mapid</code>)</strong>, I want to modify column <strong>'md_mapid' to varchar(50) DEFAULT NULL</strong> from <strong>'md_mapid' varchar(50) NOT NULL</strong>.</p>

<p>When I am running the query :
<strong><em>alter table table_name
modify column <code>md_mapid</code> varchar(50) DEFAULT NULL;</em></strong> it doesn't run and I am getting following error :
Error Code: 1171. All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead.</p>

<p>Other columns structure on both the environment is : 
'md_biobjectid' varchar(50) NOT NULL DEFAULT '' </p>

<p>'projectid' varchar(50) NOT NULL DEFAULT ''</p>

<p>MySQL version : 5.7.21-log.</p>
