/*
  Warnings:

  - You are about to drop the `Session` table. If the table is not empty, all the data it contains will be lost.
  - You are about to drop the `profiles` table. If the table is not empty, all the data it contains will be lost.
  - Made the column `resource_type_id` on table `resources` required. This step will fail if there are existing NULL values in that column.

*/
-- DropForeignKey
ALTER TABLE `profiles` DROP FOREIGN KEY `profiles_user_id_fkey`;

-- DropForeignKey
ALTER TABLE `resources` DROP FOREIGN KEY `resources_resource_type_id_fkey`;

-- DropIndex
DROP INDEX `resources_resource_type_id_fkey` ON `resources`;

-- AlterTable
ALTER TABLE `comments` MODIFY `comment` TEXT NOT NULL;

-- AlterTable
ALTER TABLE `discussions` MODIFY `description` TEXT NOT NULL,
    MODIFY `feedback` TEXT NOT NULL;

-- AlterTable
ALTER TABLE `resources` MODIFY `resource_type_id` VARCHAR(191) NOT NULL;

-- AlterTable
ALTER TABLE `users` ADD COLUMN `about` TEXT NULL,
    ADD COLUMN `is_verified` BOOLEAN NOT NULL DEFAULT false,
    ADD COLUMN `profile_image` VARCHAR(255) NULL;

-- DropTable
DROP TABLE `Session`;

-- DropTable
DROP TABLE `profiles`;

-- CreateTable
CREATE TABLE `sessions` (
    `id` VARCHAR(255) NOT NULL,
    `sid` VARCHAR(255) NOT NULL,
    `data` TEXT NOT NULL,
    `expires_at` DATETIME(3) NOT NULL,

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

-- AddForeignKey
ALTER TABLE `resources` ADD CONSTRAINT `resources_resource_type_id_fkey` FOREIGN KEY (`resource_type_id`) REFERENCES `resource_types`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
