debug license
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[license_id]` on the table `consumers` will be added. If there are existing duplicate values, this will fail.
|
||||
- A unique constraint covering the columns `[consumer_id]` on the table `licenses` will be added. If there are existing duplicate values, this will fail.
|
||||
- Added the required column `consumer_id` to the `licenses` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE `consumers` DROP FOREIGN KEY `consumers_license_id_fkey`;
|
||||
|
||||
-- DropIndex
|
||||
DROP INDEX `consumers_license_id_fkey` ON `consumers`;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE `licenses` ADD COLUMN `consumer_id` VARCHAR(191) NOT NULL;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `consumers_license_id_key` ON `consumers`(`license_id`);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX `licenses_consumer_id_key` ON `licenses`(`consumer_id`);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE `licenses` ADD CONSTRAINT `licenses_consumer_id_fkey` FOREIGN KEY (`consumer_id`) REFERENCES `consumers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -4,15 +4,16 @@ model Consumer {
|
||||
first_name String
|
||||
last_name String
|
||||
status ConsumerStatus @default(ACTIVE)
|
||||
license_id String?
|
||||
license_id String? @unique()
|
||||
|
||||
created_at DateTime @default(now()) @db.Timestamp(0)
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
license License? @relation(fields: [license_id], references: [id])
|
||||
accounts ConsumerAccount[]
|
||||
businessActivities BusinessActivity[]
|
||||
|
||||
license License?
|
||||
|
||||
@@map("consumers")
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,10 @@ model License {
|
||||
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
||||
|
||||
partner_id String?
|
||||
partner Partner? @relation(fields: [partner_id], references: [id])
|
||||
|
||||
// pos Pos @relation(fields: [pos_id], references: [id])
|
||||
partner Partner? @relation(fields: [partner_id], references: [id])
|
||||
|
||||
consumers Consumer[]
|
||||
consumer_id String @unique
|
||||
consumer Consumer @relation(fields: [consumer_id], references: [id])
|
||||
|
||||
@@map("licenses")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user