-- CreateTable
CREATE TABLE `category` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,

    UNIQUE INDEX `category_name_key`(`name`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `client` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `notes` VARCHAR(191) NOT NULL DEFAULT '',
    `email` VARCHAR(191) NOT NULL DEFAULT '',
    `phone` VARCHAR(191) NOT NULL DEFAULT '',
    `address1` VARCHAR(191) NOT NULL DEFAULT '',
    `address2` VARCHAR(191) NOT NULL DEFAULT '',
    `city` VARCHAR(191) NOT NULL DEFAULT '',
    `state` VARCHAR(191) NOT NULL DEFAULT '',
    `postcode` VARCHAR(191) NOT NULL DEFAULT '',
    `country` VARCHAR(191) NOT NULL DEFAULT 'Australia',

    UNIQUE INDEX `client_name_key`(`name`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `expenses` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `amount` DOUBLE NOT NULL DEFAULT 0,
    `category` VARCHAR(191) NOT NULL DEFAULT '',
    `description` VARCHAR(191) NOT NULL DEFAULT '',
    `jobId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `design` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `jobId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `fees` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `amount` DOUBLE NOT NULL DEFAULT 0,
    `modifier` VARCHAR(191) NOT NULL DEFAULT '',
    `type` VARCHAR(191) NOT NULL DEFAULT '',
    `description` VARCHAR(191) NOT NULL DEFAULT '',
    `taxable` BOOLEAN NOT NULL DEFAULT false,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `jobfees` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `feeId` INTEGER NULL,
    `jobId` INTEGER NULL,
    `quantity` INTEGER NOT NULL DEFAULT 0,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `job` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `title` VARCHAR(191) NOT NULL DEFAULT '',
    `description` VARCHAR(191) NOT NULL DEFAULT '',
    `published` BOOLEAN NOT NULL DEFAULT false,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `quoteKey` VARCHAR(191) NULL,
    `status` VARCHAR(191) NOT NULL DEFAULT '',
    `poNumber` VARCHAR(191) NOT NULL DEFAULT '',
    `invoiceDate` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `invoiceNumber` VARCHAR(191) NOT NULL DEFAULT '',
    `productionDate` DATETIME(3) NULL,
    `productionNotes` VARCHAR(191) NULL DEFAULT '',
    `productionPriority` INTEGER NOT NULL DEFAULT 99,
    `shippingOption` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingName` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingAddress1` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingAddress2` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingCity` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingState` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingPostcode` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingCountry` VARCHAR(191) NOT NULL DEFAULT 'Australia',
    `shippingPhone` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingEmail` VARCHAR(191) NOT NULL DEFAULT '',
    `shippingNotes` VARCHAR(191) NOT NULL DEFAULT '',
    `generalNotes` VARCHAR(191) NOT NULL DEFAULT '',
    `clientId` INTEGER NOT NULL,
    `createdById` INTEGER NOT NULL,
    `assignedToId` INTEGER NULL,

    UNIQUE INDEX `job_quoteKey_key`(`quoteKey`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `lineitem` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `color` VARCHAR(191) NOT NULL DEFAULT '',
    `xs` INTEGER NOT NULL DEFAULT 0,
    `s` INTEGER NOT NULL DEFAULT 0,
    `m` INTEGER NOT NULL DEFAULT 0,
    `l` INTEGER NOT NULL DEFAULT 0,
    `xl` INTEGER NOT NULL DEFAULT 0,
    `xxl` INTEGER NOT NULL DEFAULT 0,
    `xxxl` INTEGER NOT NULL DEFAULT 0,
    `other` INTEGER NOT NULL DEFAULT 0,
    `taxed` BOOLEAN NOT NULL DEFAULT false,
    `productId` INTEGER NOT NULL,
    `price` DOUBLE NOT NULL DEFAULT 0,
    `designId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `log` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `timestamp` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `level` VARCHAR(191) NOT NULL DEFAULT '',
    `message` TEXT NOT NULL DEFAULT '',
    `meta` JSON NULL,
    `type` VARCHAR(191) NOT NULL DEFAULT '',
    `typeId` INTEGER NOT NULL DEFAULT 0,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `imprint` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `type` VARCHAR(191) NOT NULL DEFAULT '',
    `pricingType` VARCHAR(191) NOT NULL DEFAULT '',
    `location` VARCHAR(191) NOT NULL DEFAULT '',
    `height` DOUBLE NOT NULL DEFAULT 0,
    `width` DOUBLE NOT NULL DEFAULT 0,
    `designId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `imprintimages` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `url` VARCHAR(191) NOT NULL DEFAULT '',
    `imprintId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `imprintandinks` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `imprintId` INTEGER NOT NULL,
    `inkId` INTEGER NOT NULL,
    `mesh` VARCHAR(191) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `ink` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `cost` DOUBLE NOT NULL DEFAULT 0,
    `color` VARCHAR(191) NOT NULL DEFAULT '',
    `type` VARCHAR(191) NOT NULL DEFAULT '',
    `pantone` VARCHAR(191) NOT NULL DEFAULT '',
    `cmyk` VARCHAR(191) NOT NULL DEFAULT '',
    `rgb` VARCHAR(191) NOT NULL DEFAULT '',
    `hex` VARCHAR(191) NOT NULL DEFAULT '',
    `storageCode` VARCHAR(191) NOT NULL DEFAULT '',

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `milestone` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `name` VARCHAR(191) NOT NULL DEFAULT '',
    `date` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `status` VARCHAR(191) NOT NULL DEFAULT '',
    `jobId` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `product` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `title` VARCHAR(191) NOT NULL,
    `description` VARCHAR(191) NOT NULL DEFAULT '',
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `brand` VARCHAR(191) NOT NULL DEFAULT '',
    `brandId` VARCHAR(191) NOT NULL DEFAULT '',
    `cost` DOUBLE NOT NULL DEFAULT 0,
    `modifier` DOUBLE NOT NULL DEFAULT 1,
    `price` DOUBLE NOT NULL DEFAULT 0,
    `categoryId` INTEGER NOT NULL,

    UNIQUE INDEX `product_title_key`(`title`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `primaryMatrix` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `quantity` INTEGER NOT NULL DEFAULT 0,
    `markUp` INTEGER NOT NULL DEFAULT 0,
    `colour1` DOUBLE NOT NULL DEFAULT 0,
    `colour2` DOUBLE NOT NULL DEFAULT 0,
    `colour3` DOUBLE NOT NULL DEFAULT 0,
    `colour4` DOUBLE NOT NULL DEFAULT 0,
    `colour5` DOUBLE NOT NULL DEFAULT 0,
    `colour6` DOUBLE NOT NULL DEFAULT 0,
    `colour7` DOUBLE NOT NULL DEFAULT 0,
    `colour8` DOUBLE NOT NULL DEFAULT 0,
    `colour9` DOUBLE NOT NULL DEFAULT 0,
    `colour10` DOUBLE NOT NULL DEFAULT 0,
    `colour11` DOUBLE NOT NULL DEFAULT 0,
    `colour12` DOUBLE NOT NULL DEFAULT 0,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `report` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `title` VARCHAR(191) NOT NULL,
    `description` VARCHAR(191) NOT NULL DEFAULT '',
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `body` VARCHAR(191) NOT NULL DEFAULT '',

    UNIQUE INDEX `report_title_key`(`title`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `secondaryMatrix` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `quantity` INTEGER NOT NULL DEFAULT 0,
    `markUp` INTEGER NOT NULL DEFAULT 0,
    `colour1` DOUBLE NOT NULL DEFAULT 0,
    `colour2` DOUBLE NOT NULL DEFAULT 0,
    `colour3` DOUBLE NOT NULL DEFAULT 0,
    `colour4` DOUBLE NOT NULL DEFAULT 0,
    `colour5` DOUBLE NOT NULL DEFAULT 0,
    `colour6` DOUBLE NOT NULL DEFAULT 0,
    `colour7` DOUBLE NOT NULL DEFAULT 0,
    `colour8` DOUBLE NOT NULL DEFAULT 0,
    `colour9` DOUBLE NOT NULL DEFAULT 0,
    `colour10` DOUBLE NOT NULL DEFAULT 0,
    `colour11` DOUBLE NOT NULL DEFAULT 0,
    `colour12` DOUBLE NOT NULL DEFAULT 0,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `settings` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(191) NOT NULL,
    `value` VARCHAR(191) NOT NULL DEFAULT '',

    UNIQUE INDEX `settings_name_key`(`name`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `tertiaryMatrix` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `quantity` INTEGER NOT NULL DEFAULT 0,
    `markUp` INTEGER NOT NULL DEFAULT 0,
    `colour1` DOUBLE NOT NULL DEFAULT 0,
    `colour2` DOUBLE NOT NULL DEFAULT 0,
    `colour3` DOUBLE NOT NULL DEFAULT 0,
    `colour4` DOUBLE NOT NULL DEFAULT 0,
    `colour5` DOUBLE NOT NULL DEFAULT 0,
    `colour6` DOUBLE NOT NULL DEFAULT 0,
    `colour7` DOUBLE NOT NULL DEFAULT 0,
    `colour8` DOUBLE NOT NULL DEFAULT 0,
    `colour9` DOUBLE NOT NULL DEFAULT 0,
    `colour10` DOUBLE NOT NULL DEFAULT 0,
    `colour11` DOUBLE NOT NULL DEFAULT 0,
    `colour12` DOUBLE NOT NULL DEFAULT 0,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `user` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `email` VARCHAR(191) NOT NULL,
    `name` VARCHAR(191) NOT NULL,
    `password` VARCHAR(191) NOT NULL,
    `role` VARCHAR(191) NOT NULL DEFAULT 'USER',
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,
    `uuid` VARCHAR(191) NOT NULL,
    `active` BOOLEAN NOT NULL DEFAULT false,
    `clientId` INTEGER NULL,
    `favourite` BOOLEAN NOT NULL DEFAULT false,
    `phone` VARCHAR(191) NOT NULL DEFAULT '',
    `address1` VARCHAR(191) NOT NULL DEFAULT '',
    `address2` VARCHAR(191) NOT NULL DEFAULT '',
    `city` VARCHAR(191) NOT NULL DEFAULT '',
    `state` VARCHAR(191) NOT NULL DEFAULT '',
    `postcode` VARCHAR(191) NOT NULL DEFAULT '',
    `country` VARCHAR(191) NOT NULL DEFAULT 'Australia',

    UNIQUE INDEX `user_email_key`(`email`),
    UNIQUE INDEX `user_uuid_key`(`uuid`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `_jobTouser` (
    `A` INTEGER NOT NULL,
    `B` INTEGER NOT NULL,

    UNIQUE INDEX `_jobTouser_AB_unique`(`A`, `B`),
    INDEX `_jobTouser_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `expenses` ADD CONSTRAINT `expenses_jobId_fkey` FOREIGN KEY (`jobId`) REFERENCES `job`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `design` ADD CONSTRAINT `design_jobId_fkey` FOREIGN KEY (`jobId`) REFERENCES `job`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `jobfees` ADD CONSTRAINT `jobfees_feeId_fkey` FOREIGN KEY (`feeId`) REFERENCES `fees`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `jobfees` ADD CONSTRAINT `jobfees_jobId_fkey` FOREIGN KEY (`jobId`) REFERENCES `job`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `job` ADD CONSTRAINT `job_clientId_fkey` FOREIGN KEY (`clientId`) REFERENCES `client`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `job` ADD CONSTRAINT `job_createdById_fkey` FOREIGN KEY (`createdById`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `job` ADD CONSTRAINT `job_assignedToId_fkey` FOREIGN KEY (`assignedToId`) REFERENCES `user`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `lineitem` ADD CONSTRAINT `lineitem_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `product`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `lineitem` ADD CONSTRAINT `lineitem_designId_fkey` FOREIGN KEY (`designId`) REFERENCES `design`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `imprint` ADD CONSTRAINT `imprint_designId_fkey` FOREIGN KEY (`designId`) REFERENCES `design`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `imprintimages` ADD CONSTRAINT `imprintimages_imprintId_fkey` FOREIGN KEY (`imprintId`) REFERENCES `imprint`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `imprintandinks` ADD CONSTRAINT `imprintandinks_imprintId_fkey` FOREIGN KEY (`imprintId`) REFERENCES `imprint`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `imprintandinks` ADD CONSTRAINT `imprintandinks_inkId_fkey` FOREIGN KEY (`inkId`) REFERENCES `ink`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `milestone` ADD CONSTRAINT `milestone_jobId_fkey` FOREIGN KEY (`jobId`) REFERENCES `job`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `product` ADD CONSTRAINT `product_categoryId_fkey` FOREIGN KEY (`categoryId`) REFERENCES `category`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `user` ADD CONSTRAINT `user_clientId_fkey` FOREIGN KEY (`clientId`) REFERENCES `client`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_jobTouser` ADD CONSTRAINT `_jobTouser_A_fkey` FOREIGN KEY (`A`) REFERENCES `job`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `_jobTouser` ADD CONSTRAINT `_jobTouser_B_fkey` FOREIGN KEY (`B`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
