create license management

This commit is contained in:
2026-04-06 13:31:40 +03:30
parent c02e7afca1
commit 1160d81cdb
42 changed files with 1233 additions and 522 deletions
@@ -0,0 +1,2 @@
-- DropIndex
DROP INDEX `accounts_password_key` ON `accounts`;
@@ -0,0 +1,17 @@
-- DropForeignKey
ALTER TABLE `licenses` DROP FOREIGN KEY `licenses_partner_id_fkey`;
-- DropIndex
DROP INDEX `licenses_partner_id_fkey` ON `licenses`;
-- AlterTable
ALTER TABLE `consumers` ADD COLUMN `license_id` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `licenses` MODIFY `partner_id` VARCHAR(191) NULL;
-- AddForeignKey
ALTER TABLE `consumers` ADD CONSTRAINT `consumers_license_id_fkey` FOREIGN KEY (`license_id`) REFERENCES `licenses`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `licenses` ADD CONSTRAINT `licenses_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
@@ -0,0 +1,14 @@
/*
Warnings:
- You are about to drop the column `pos_id` on the `licenses` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE `licenses` DROP FOREIGN KEY `licenses_pos_id_fkey`;
-- DropIndex
DROP INDEX `licenses_pos_id_fkey` ON `licenses`;
-- AlterTable
ALTER TABLE `licenses` DROP COLUMN `pos_id`;