Cannot drop primary key

I needed to change a table from a single field PK to a composite PK, using the following syntax

, (table) => {
  return {
    pk: primaryKey(table.playerID, table.teamID, table.competitionID, table.seasonID),
  };
});


I ran the drizzle kit generate, and it spat out

ALTER TABLE `teamStats` DROP PRIMARY KEY;
ALTER TABLE `teamStats` ADD PRIMARY KEY(`competitionID`,`seasonID`,`teamID`);


but this doesn't work.

I tried runnign it manually, with the addition of
SET foreign_key_checks = 0;
at the start, but no luck.

A quick google suggests the FK needs removing, but drizzle kit isn't adding that in.

Using drizzle kit 0.19.12
Was this page helpful?