-- Drop polymorphic `notes` table and FK from leads to `campaigns`, then drop `campaigns`.

ALTER TABLE `notes` DROP FOREIGN KEY `notes_leadId_fkey`;
ALTER TABLE `notes` DROP FOREIGN KEY `notes_contactId_fkey`;
ALTER TABLE `notes` DROP FOREIGN KEY `notes_accountId_fkey`;
ALTER TABLE `notes` DROP FOREIGN KEY `notes_opportunityId_fkey`;
ALTER TABLE `notes` DROP FOREIGN KEY `notes_ticketId_fkey`;

DROP TABLE `notes`;

ALTER TABLE `leads` DROP FOREIGN KEY `leads_campaignId_fkey`;
ALTER TABLE `leads` DROP COLUMN `campaignId`;

DROP TABLE `campaigns`;
