/*
  Warnings:

  - You are about to drop the column `cat_id` on the `category` table. All the data in the column will be lost.
  - You are about to drop the column `parlourId` on the `category` table. All the data in the column will be lost.
  - You are about to drop the column `digitalUrl` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `dimensions` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `isActive` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `mediaId` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `productType` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `sku` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `stockQty` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `translations` on the `product` table. All the data in the column will be lost.
  - You are about to drop the column `weightGrams` on the `product` table. All the data in the column will be lost.
  - You are about to alter the column `price` on the `product` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Double`.
  - You are about to drop the `_parlourtoparlourplan` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `admin` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `admincategory` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `adminservices` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `apikey` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `apiusage` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `applicationmodules` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `booking` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `bookingschedule` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `bookingtransaction` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `branchmanager` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `businesssetting` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `customer` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `customerparlour` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `emailqueuelog` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `livelocation` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `loyaltypoint` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `loyaltyrule` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `loyaltytransaction` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `media` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `notification` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `notificationtracker` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlour` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourbankaccount` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourbanner` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourbranding` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourbreak` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourcommission` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourearning` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourgroup` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourholiday` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourkyc` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourplan` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parloursubscription` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourtiming` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `parlourzone` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `payoutbatch` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `payouttransaction` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `planlimit` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `planmodule` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `productcategory` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `referral` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `report` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `revenuereport` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `service` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `servicegallery` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `servicespecialist` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `servicevariation` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `staff` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `staffattendance` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `staffperformancereport` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `staffpermission` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `staffshift` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `subcategory` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `superadmin` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `traveltime` table. If the table is not empty, all the data it contains will be lost.
  - Added the required column `name` to the `Category` table without a default value. This is not possible if the table is not empty.
  - Added the required column `size` to the `Product` table without a default value. This is not possible if the table is not empty.

*/
-- DropForeignKey
ALTER TABLE `_parlourtoparlourplan` DROP FOREIGN KEY `_ParlourToParlourPlan_A_fkey`;

-- DropForeignKey
ALTER TABLE `_parlourtoparlourplan` DROP FOREIGN KEY `_ParlourToParlourPlan_B_fkey`;

-- DropForeignKey
ALTER TABLE `admin` DROP FOREIGN KEY `Admin_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `admin` DROP FOREIGN KEY `Admin_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `admincategory` DROP FOREIGN KEY `AdminCategory_image_fkey`;

-- DropForeignKey
ALTER TABLE `adminservices` DROP FOREIGN KEY `AdminServices_categoryId_fkey`;

-- DropForeignKey
ALTER TABLE `apikey` DROP FOREIGN KEY `ApiKey_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `apiusage` DROP FOREIGN KEY `ApiUsage_adminId_fkey`;

-- DropForeignKey
ALTER TABLE `apiusage` DROP FOREIGN KEY `ApiUsage_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `apiusage` DROP FOREIGN KEY `ApiUsage_superAdminId_fkey`;

-- DropForeignKey
ALTER TABLE `booking` DROP FOREIGN KEY `Booking_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `booking` DROP FOREIGN KEY `Booking_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `booking` DROP FOREIGN KEY `Booking_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `booking` DROP FOREIGN KEY `Booking_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `booking` DROP FOREIGN KEY `Booking_variationId_fkey`;

-- DropForeignKey
ALTER TABLE `bookingschedule` DROP FOREIGN KEY `BookingSchedule_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `bookingschedule` DROP FOREIGN KEY `BookingSchedule_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `bookingschedule` DROP FOREIGN KEY `BookingSchedule_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `bookingtransaction` DROP FOREIGN KEY `BookingTransaction_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `branchmanager` DROP FOREIGN KEY `BranchManager_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `branchmanager` DROP FOREIGN KEY `BranchManager_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `category` DROP FOREIGN KEY `Category_cat_id_fkey`;

-- DropForeignKey
ALTER TABLE `category` DROP FOREIGN KEY `Category_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `customer` DROP FOREIGN KEY `Customer_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `customer` DROP FOREIGN KEY `Customer_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `customer` DROP FOREIGN KEY `Customer_referredById_fkey`;

-- DropForeignKey
ALTER TABLE `customerparlour` DROP FOREIGN KEY `CustomerParlour_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `customerparlour` DROP FOREIGN KEY `CustomerParlour_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `livelocation` DROP FOREIGN KEY `LiveLocation_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `livelocation` DROP FOREIGN KEY `LiveLocation_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `livelocation` DROP FOREIGN KEY `LiveLocation_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `livelocation` DROP FOREIGN KEY `LiveLocation_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `loyaltypoint` DROP FOREIGN KEY `LoyaltyPoint_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `loyaltytransaction` DROP FOREIGN KEY `LoyaltyTransaction_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `loyaltytransaction` DROP FOREIGN KEY `LoyaltyTransaction_ruleId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_receiverAdminId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_receiverCustId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_receiverStaffId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_senderAdminId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_senderStaffId_fkey`;

-- DropForeignKey
ALTER TABLE `notification` DROP FOREIGN KEY `Notification_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `notificationtracker` DROP FOREIGN KEY `NotificationTracker_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `notificationtracker` DROP FOREIGN KEY `NotificationTracker_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `notificationtracker` DROP FOREIGN KEY `NotificationTracker_userId_fkey`;

-- DropForeignKey
ALTER TABLE `parlour` DROP FOREIGN KEY `Parlour_groupId_fkey`;

-- DropForeignKey
ALTER TABLE `parlour` DROP FOREIGN KEY `Parlour_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlour` DROP FOREIGN KEY `Parlour_parlourZoneId_fkey`;

-- DropForeignKey
ALTER TABLE `parlour` DROP FOREIGN KEY `Parlour_superAdminId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbankaccount` DROP FOREIGN KEY `ParlourBankAccount_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbanner` DROP FOREIGN KEY `ParlourBanner_BannerImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbanner` DROP FOREIGN KEY `ParlourBanner_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbranding` DROP FOREIGN KEY `ParlourBranding_coverImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbranding` DROP FOREIGN KEY `ParlourBranding_faviconImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbranding` DROP FOREIGN KEY `ParlourBranding_logoImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbranding` DROP FOREIGN KEY `ParlourBranding_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbranding` DROP FOREIGN KEY `ParlourBranding_splashImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourbreak` DROP FOREIGN KEY `ParlourBreak_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourcommission` DROP FOREIGN KEY `ParlourCommission_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourcommission` DROP FOREIGN KEY `ParlourCommission_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourearning` DROP FOREIGN KEY `ParlourEarning_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourearning` DROP FOREIGN KEY `ParlourEarning_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourgroup` DROP FOREIGN KEY `ParlourGroup_logoImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourholiday` DROP FOREIGN KEY `ParlourHoliday_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourkyc` DROP FOREIGN KEY `ParlourKyc_kycImageId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourkyc` DROP FOREIGN KEY `ParlourKyc_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parloursubscription` DROP FOREIGN KEY `ParlourSubscription_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `parloursubscription` DROP FOREIGN KEY `ParlourSubscription_planId_fkey`;

-- DropForeignKey
ALTER TABLE `parlourtiming` DROP FOREIGN KEY `ParlourTiming_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `payouttransaction` DROP FOREIGN KEY `PayoutTransaction_batchId_fkey`;

-- DropForeignKey
ALTER TABLE `payouttransaction` DROP FOREIGN KEY `PayoutTransaction_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `planlimit` DROP FOREIGN KEY `PlanLimit_planId_fkey`;

-- DropForeignKey
ALTER TABLE `planmodule` DROP FOREIGN KEY `PlanModule_applicationModuleId_fkey`;

-- DropForeignKey
ALTER TABLE `planmodule` DROP FOREIGN KEY `PlanModule_planId_fkey`;

-- DropForeignKey
ALTER TABLE `product` DROP FOREIGN KEY `Product_categoryId_fkey`;

-- DropForeignKey
ALTER TABLE `product` DROP FOREIGN KEY `Product_mediaId_fkey`;

-- DropForeignKey
ALTER TABLE `productcategory` DROP FOREIGN KEY `ProductCategory_image_fkey`;

-- DropForeignKey
ALTER TABLE `referral` DROP FOREIGN KEY `Referral_referredUserId_fkey`;

-- DropForeignKey
ALTER TABLE `referral` DROP FOREIGN KEY `Referral_referrerId_fkey`;

-- DropForeignKey
ALTER TABLE `report` DROP FOREIGN KEY `Report_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `revenuereport` DROP FOREIGN KEY `RevenueReport_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `revenuereport` DROP FOREIGN KEY `RevenueReport_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `revenuereport` DROP FOREIGN KEY `RevenueReport_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `revenuereport` DROP FOREIGN KEY `RevenueReport_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `service` DROP FOREIGN KEY `Service_adminServiceId_fkey`;

-- DropForeignKey
ALTER TABLE `service` DROP FOREIGN KEY `Service_catId_fkey`;

-- DropForeignKey
ALTER TABLE `service` DROP FOREIGN KEY `Service_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `servicegallery` DROP FOREIGN KEY `ServiceGallery_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `servicegallery` DROP FOREIGN KEY `ServiceGallery_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `servicespecialist` DROP FOREIGN KEY `ServiceSpecialist_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `servicespecialist` DROP FOREIGN KEY `ServiceSpecialist_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `servicevariation` DROP FOREIGN KEY `ServiceVariation_serviceId_fkey`;

-- DropForeignKey
ALTER TABLE `staff` DROP FOREIGN KEY `Staff_adminId_fkey`;

-- DropForeignKey
ALTER TABLE `staff` DROP FOREIGN KEY `Staff_imageId_fkey`;

-- DropForeignKey
ALTER TABLE `staff` DROP FOREIGN KEY `Staff_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `staffattendance` DROP FOREIGN KEY `StaffAttendance_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `staffattendance` DROP FOREIGN KEY `StaffAttendance_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `staffperformancereport` DROP FOREIGN KEY `StaffPerformanceReport_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `staffperformancereport` DROP FOREIGN KEY `StaffPerformanceReport_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `staffpermission` DROP FOREIGN KEY `StaffPermission_grantedById_fkey`;

-- DropForeignKey
ALTER TABLE `staffpermission` DROP FOREIGN KEY `StaffPermission_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `staffpermission` DROP FOREIGN KEY `StaffPermission_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `staffshift` DROP FOREIGN KEY `StaffShift_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `staffshift` DROP FOREIGN KEY `StaffShift_staffId_fkey`;

-- DropForeignKey
ALTER TABLE `subcategory` DROP FOREIGN KEY `SubCategory_categoryId_fkey`;

-- DropForeignKey
ALTER TABLE `subcategory` DROP FOREIGN KEY `SubCategory_parlourId_fkey`;

-- DropForeignKey
ALTER TABLE `subcategory` DROP FOREIGN KEY `SubCategory_subcat_image_fkey`;

-- DropForeignKey
ALTER TABLE `traveltime` DROP FOREIGN KEY `TravelTime_bookingId_fkey`;

-- DropForeignKey
ALTER TABLE `traveltime` DROP FOREIGN KEY `TravelTime_customerId_fkey`;

-- DropForeignKey
ALTER TABLE `traveltime` DROP FOREIGN KEY `TravelTime_staffId_fkey`;

-- DropIndex
DROP INDEX `Category_cat_id_fkey` ON `category`;

-- DropIndex
DROP INDEX `Category_parlourId_idx` ON `category`;

-- DropIndex
DROP INDEX `Product_categoryId_fkey` ON `product`;

-- DropIndex
DROP INDEX `Product_mediaId_fkey` ON `product`;

-- DropIndex
DROP INDEX `Product_sku_key` ON `product`;

-- AlterTable
ALTER TABLE `category` DROP COLUMN `cat_id`,
    DROP COLUMN `parlourId`,
    ADD COLUMN `description` VARCHAR(191) NULL,
    ADD COLUMN `image` VARCHAR(191) NULL,
    ADD COLUMN `name` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `product` DROP COLUMN `digitalUrl`,
    DROP COLUMN `dimensions`,
    DROP COLUMN `isActive`,
    DROP COLUMN `mediaId`,
    DROP COLUMN `productType`,
    DROP COLUMN `sku`,
    DROP COLUMN `stockQty`,
    DROP COLUMN `translations`,
    DROP COLUMN `weightGrams`,
    ADD COLUMN `image` VARCHAR(191) NULL,
    ADD COLUMN `size` VARCHAR(191) NOT NULL,
    ADD COLUMN `stock` INTEGER NOT NULL DEFAULT 0,
    ADD COLUMN `userId` INTEGER NULL,
    MODIFY `price` DOUBLE NOT NULL;

-- DropTable
DROP TABLE `_parlourtoparlourplan`;

-- DropTable
DROP TABLE `admin`;

-- DropTable
DROP TABLE `admincategory`;

-- DropTable
DROP TABLE `adminservices`;

-- DropTable
DROP TABLE `apikey`;

-- DropTable
DROP TABLE `apiusage`;

-- DropTable
DROP TABLE `applicationmodules`;

-- DropTable
DROP TABLE `booking`;

-- DropTable
DROP TABLE `bookingschedule`;

-- DropTable
DROP TABLE `bookingtransaction`;

-- DropTable
DROP TABLE `branchmanager`;

-- DropTable
DROP TABLE `businesssetting`;

-- DropTable
DROP TABLE `customer`;

-- DropTable
DROP TABLE `customerparlour`;

-- DropTable
DROP TABLE `emailqueuelog`;

-- DropTable
DROP TABLE `livelocation`;

-- DropTable
DROP TABLE `loyaltypoint`;

-- DropTable
DROP TABLE `loyaltyrule`;

-- DropTable
DROP TABLE `loyaltytransaction`;

-- DropTable
DROP TABLE `media`;

-- DropTable
DROP TABLE `notification`;

-- DropTable
DROP TABLE `notificationtracker`;

-- DropTable
DROP TABLE `parlour`;

-- DropTable
DROP TABLE `parlourbankaccount`;

-- DropTable
DROP TABLE `parlourbanner`;

-- DropTable
DROP TABLE `parlourbranding`;

-- DropTable
DROP TABLE `parlourbreak`;

-- DropTable
DROP TABLE `parlourcommission`;

-- DropTable
DROP TABLE `parlourearning`;

-- DropTable
DROP TABLE `parlourgroup`;

-- DropTable
DROP TABLE `parlourholiday`;

-- DropTable
DROP TABLE `parlourkyc`;

-- DropTable
DROP TABLE `parlourplan`;

-- DropTable
DROP TABLE `parloursubscription`;

-- DropTable
DROP TABLE `parlourtiming`;

-- DropTable
DROP TABLE `parlourzone`;

-- DropTable
DROP TABLE `payoutbatch`;

-- DropTable
DROP TABLE `payouttransaction`;

-- DropTable
DROP TABLE `planlimit`;

-- DropTable
DROP TABLE `planmodule`;

-- DropTable
DROP TABLE `productcategory`;

-- DropTable
DROP TABLE `referral`;

-- DropTable
DROP TABLE `report`;

-- DropTable
DROP TABLE `revenuereport`;

-- DropTable
DROP TABLE `service`;

-- DropTable
DROP TABLE `servicegallery`;

-- DropTable
DROP TABLE `servicespecialist`;

-- DropTable
DROP TABLE `servicevariation`;

-- DropTable
DROP TABLE `staff`;

-- DropTable
DROP TABLE `staffattendance`;

-- DropTable
DROP TABLE `staffperformancereport`;

-- DropTable
DROP TABLE `staffpermission`;

-- DropTable
DROP TABLE `staffshift`;

-- DropTable
DROP TABLE `subcategory`;

-- DropTable
DROP TABLE `superadmin`;

-- DropTable
DROP TABLE `traveltime`;

-- CreateTable
CREATE TABLE `User` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(191) NOT NULL,
    `email` VARCHAR(191) NOT NULL,
    `password` VARCHAR(191) NOT NULL,

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

-- CreateTable
CREATE TABLE `Enquiry` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(191) NOT NULL,
    `email` VARCHAR(191) NOT NULL,
    `phone` VARCHAR(191) NULL,
    `message` VARCHAR(191) NOT NULL,
    `createdBy` INTEGER NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updatedAt` DATETIME(3) NOT NULL,

    INDEX `Enquiry_createdBy_idx`(`createdBy`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `Product` ADD CONSTRAINT `Product_categoryId_fkey` FOREIGN KEY (`categoryId`) REFERENCES `Category`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `Product` ADD CONSTRAINT `Product_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
