···11+/*
22+ Warnings:
33+44+ - You are about to drop the column `company` on the `vacancies` table. All the data in the column will be lost.
55+ - You are about to drop the column `jobType` on the `vacancies` table. All the data in the column will be lost.
66+ - Added the required column `companyId` to the `vacancies` table without a default value. This is not possible if the table is not empty.
77+ - Added the required column `roleId` to the `vacancies` table without a default value. This is not possible if the table is not empty.
88+99+*/
1010+-- AlterTable
1111+ALTER TABLE "vacancies" DROP COLUMN "company",
1212+DROP COLUMN "jobType",
1313+ADD COLUMN "companyId" TEXT NOT NULL,
1414+ADD COLUMN "levelId" TEXT,
1515+ADD COLUMN "roleId" TEXT NOT NULL;
1616+1717+-- CreateTable
1818+CREATE TABLE "_SkillToVacancy" (
1919+ "A" TEXT NOT NULL,
2020+ "B" TEXT NOT NULL,
2121+2222+ CONSTRAINT "_SkillToVacancy_AB_pkey" PRIMARY KEY ("A","B")
2323+);
2424+2525+-- CreateIndex
2626+CREATE INDEX "_SkillToVacancy_B_index" ON "_SkillToVacancy"("B");
2727+2828+-- AddForeignKey
2929+ALTER TABLE "vacancies" ADD CONSTRAINT "vacancies_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "companies"("id") ON DELETE CASCADE ON UPDATE CASCADE;
3030+3131+-- AddForeignKey
3232+ALTER TABLE "vacancies" ADD CONSTRAINT "vacancies_roleId_fkey" FOREIGN KEY ("roleId") REFERENCES "roles"("id") ON DELETE CASCADE ON UPDATE CASCADE;
3333+3434+-- AddForeignKey
3535+ALTER TABLE "vacancies" ADD CONSTRAINT "vacancies_levelId_fkey" FOREIGN KEY ("levelId") REFERENCES "levels"("id") ON DELETE CASCADE ON UPDATE CASCADE;
3636+3737+-- AddForeignKey
3838+ALTER TABLE "_SkillToVacancy" ADD CONSTRAINT "_SkillToVacancy_A_fkey" FOREIGN KEY ("A") REFERENCES "skills"("id") ON DELETE CASCADE ON UPDATE CASCADE;
3939+4040+-- AddForeignKey
4141+ALTER TABLE "_SkillToVacancy" ADD CONSTRAINT "_SkillToVacancy_B_fkey" FOREIGN KEY ("B") REFERENCES "vacancies"("id") ON DELETE CASCADE ON UPDATE CASCADE;
···11+/*
22+ Warnings:
33+44+ - Added the required column `ownerId` to the `vacancies` table without a default value. This is not possible if the table is not empty.
55+66+*/
77+-- AlterTable
88+ALTER TABLE "vacancies" ADD COLUMN "isPublic" BOOLEAN NOT NULL DEFAULT false,
99+ADD COLUMN "ownerId" TEXT NOT NULL;
1010+1111+-- AddForeignKey
1212+ALTER TABLE "vacancies" ADD CONSTRAINT "vacancies_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
···11+/*
22+ Warnings:
33+44+ - You are about to drop the column `userId` on the `vacancies` table. All the data in the column will be lost.
55+66+*/
77+-- DropForeignKey
88+ALTER TABLE "public"."vacancies" DROP CONSTRAINT "vacancies_userId_fkey";
99+1010+-- AlterTable
1111+ALTER TABLE "vacancies" DROP COLUMN "userId";
···11+/*
22+ Warnings:
33+44+ - The `status` column on the `applications` table would be dropped and recreated. This will lead to data loss if there is data in the column.
55+66+*/
77+-- CreateEnum
88+CREATE TYPE "ApplicationStatus" AS ENUM ('PENDING', 'ACCEPTED', 'REJECTED', 'WITHDRAWN');
99+1010+-- AlterTable
1111+ALTER TABLE "applications" DROP COLUMN "status",
1212+ADD COLUMN "status" "ApplicationStatus" NOT NULL DEFAULT 'PENDING';
···11+/*
22+ Warnings:
33+44+ - You are about to drop the column `status` on the `applications` table. All the data in the column will be lost.
55+ - Added the required column `statusId` to the `applications` table without a default value. This is not possible if the table is not empty.
66+77+*/
88+-- AlterTable
99+ALTER TABLE "applications" DROP COLUMN "status",
1010+ADD COLUMN "statusId" TEXT NOT NULL;
1111+1212+-- DropEnum
1313+DROP TYPE "public"."ApplicationStatus";
1414+1515+-- CreateTable
1616+CREATE TABLE "application_statuses" (
1717+ "id" TEXT NOT NULL,
1818+ "name" TEXT NOT NULL,
1919+ "description" TEXT,
2020+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
2121+ "updatedAt" TIMESTAMP(3) NOT NULL,
2222+2323+ CONSTRAINT "application_statuses_pkey" PRIMARY KEY ("id")
2424+);
2525+2626+-- CreateIndex
2727+CREATE UNIQUE INDEX "application_statuses_name_key" ON "application_statuses"("name");
2828+2929+-- AddForeignKey
3030+ALTER TABLE "applications" ADD CONSTRAINT "applications_statusId_fkey" FOREIGN KEY ("statusId") REFERENCES "application_statuses"("id") ON DELETE RESTRICT ON UPDATE CASCADE;