title: MYSQL 5.5 Drop Primary Key
body: <p>I am upgrading my quartz.net version from 1.0.3 to 2.0.2
  There is a migration script for database schema, which was was written for MSSQL, and I am trying to write a MYSQL version of it.</p>
  
  <p>However, I haven't been able to drop primary keys (which I need to).</p>
  
  <p>Original MSSQL version of script:</p>
  
  <pre><code>ALTER TABLE BLOB_TRIGGERS DROP CONSTRAINT BLOB_TRIGGERS_PKEY;
  ALTER TABLE BLOB_TRIGGERS DROP CONSTRAINT BLOB_TRIGGERS_TRIGGER_NAME_FKEY;
  ALTER TABLE SIMPLE_TRIGGERS DROP CONSTRAINT PK_SIMPLE_TRIGGERS;
  ALTER TABLE SIMPLE_TRIGGERS DROP CONSTRAINT FK_SIMPLE_TRIGGERS_TRIGGERS;
  ALTER TABLE CRON_TRIGGERS DROP CONSTRAINT PK_CRON_TRIGGERS;
  ALTER TABLE CRON_TRIGGERS DROP CONSTRAINT FK_CRON_TRIGGERS_TRIGGERS;
  ALTER TABLE TRIGGERS DROP CONSTRAINT PK_TRIGGERS;
  ALTER TABLE TRIGGERS DROP CONSTRAINT FK_TRIGGERS_JOB_DETAILS;
  ALTER TABLE JOB_DETAILS DROP CONSTRAINT PK_JOB_DETAILS;
  </code></pre>
  
  <p>For simplicity, I am trying the first statement there</p>
  
  <pre><code>ALTER TABLE BLOB_TRIGGERS DROP CONSTRAINT BLOB_TRIGGERS_PKEY;
  </code></pre>
  
  <p>Here are what I have tried and results:</p>
  
  <ul>
  <li>ALTER TABLE BLOB_TRIGGERS DROP PRIMARY KEY;</li>
  </ul>
  
  <blockquote>
    <p>[Err] 1025 - Error on rename of '.\quartz_local#sql-df8_9' to '.\quartz_local\BLOB_TRIGGERS' (errno: 150)</p>
  </blockquote>
  
  <ul>
  <li>ALTER TABLE BLOB_TRIGGERS DROP INDEX 'PRIMARY';</li>
  </ul>
  
  <blockquote>
    <p>[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''PRIMARY'' at line 1</p>
  </blockquote>
  
  <ul>
  <li>ALTER TABLE BLOB_TRIGGERS DROP INDEX <code>PRIMARY</code>;</li>
  </ul>
  
  <blockquote>
    <p>[Err] 1025 - Error on rename of '.\quartz_local#sql-df8_9' to '.\quartz_local\BLOB_TRIGGERS' (errno: 150)</p>
  </blockquote>
  
  <ul>
  <li>ALTER TABLE <code>BLOB_TRIGGERS</code> DROP PRIMARY KEY;</li>
  </ul>
  
  <blockquote>
    <p>[Err] 1025 - Error on rename of '.\quartz_local#sql-df8_9' to '.\quartz_local\BLOB_TRIGGERS' (errno: 150)</p>
  </blockquote>
  
  <p>My Mysql version is 5.5.16</p>
  
  <p>EDIT: To check the indexes:
  <img src="https://i.stack.imgur.com/deA0V.jpg" alt="MYSQL Show index results"></p>
  
  <p>EDIT2: Foreign keys on request:
  <img src="https://i.stack.imgur.com/2FZ8r.jpg" alt="Create table sql"></p>