/*
  Warnings:

  - You are about to drop the column `activated_license_id` on the `consumers` table. All the data in the column will be lost.
  - You are about to drop the column `activation_expires_at` on the `licenses` table. All the data in the column will be lost.
  - You are about to drop the column `partner_id` on the `licenses` table. All the data in the column will be lost.
  - You are about to drop the column `license_quota` on the `partners` table. All the data in the column will be lost.
  - Added the required column `consumer_id` to the `activated_licenses` table without a default value. This is not possible if the table is not empty.
  - Added the required column `activation_expires_at` to the `charged_license_transactions` table without a default value. This is not possible if the table is not empty.

*/
-- DropForeignKey
ALTER TABLE `consumers` DROP FOREIGN KEY `consumers_activated_license_id_fkey`;

-- DropForeignKey
ALTER TABLE `licenses` DROP FOREIGN KEY `licenses_partner_id_fkey`;

-- DropIndex
DROP INDEX `consumers_activated_license_id_key` ON `consumers`;

-- DropIndex
DROP INDEX `licenses_partner_id_fkey` ON `licenses`;

-- AlterTable
ALTER TABLE `activated_licenses` ADD COLUMN `consumer_id` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `charged_license_transactions` ADD COLUMN `activation_expires_at` DATETIME(3) NOT NULL;

-- AlterTable
ALTER TABLE `consumers` DROP COLUMN `activated_license_id`;

-- AlterTable
ALTER TABLE `licenses` DROP COLUMN `activation_expires_at`,
    DROP COLUMN `partner_id`;

-- AlterTable
ALTER TABLE `partners` DROP COLUMN `license_quota`;

-- AddForeignKey
ALTER TABLE `activated_licenses` ADD CONSTRAINT `activated_licenses_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
