-- CreateEnum
CREATE TYPE "ProjectSize" AS ENUM ('Big', 'MediumSized', 'Small');

-- CreateTable
CREATE TABLE "Project" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "label" TEXT NOT NULL,
    "size" "ProjectSize" NOT NULL DEFAULT 'MediumSized',
    "imageUrl" TEXT,
    "link" TEXT NOT NULL,
    "linkIsDemo" BOOLEAN NOT NULL DEFAULT false,
    "sourceCode" TEXT,
    "description" TEXT NOT NULL,
    "why" TEXT NOT NULL,
    "note" TEXT,
    "tags" TEXT[],
    "loc" INTEGER,
    "locEndpoint" TEXT,
    "featured" BOOLEAN NOT NULL DEFAULT false,
    "sortIndex" INTEGER NOT NULL DEFAULT 0,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "Project_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "WorkExperience" (
    "id" TEXT NOT NULL,
    "company" TEXT NOT NULL,
    "role" TEXT NOT NULL,
    "fromDate" TIMESTAMP(3) NOT NULL,
    "toDate" TIMESTAMP(3),
    "url" TEXT,
    "iconUrl" TEXT,
    "summary" TEXT NOT NULL,
    "tags" TEXT[],
    "sortIndex" INTEGER NOT NULL DEFAULT 0,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "WorkExperience_pkey" PRIMARY KEY ("id")
);

-- CreateTable
CREATE TABLE "Affiliate" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "link" TEXT NOT NULL,
    "icon" TEXT NOT NULL,
    "location" TEXT NOT NULL,
    "provides" TEXT[],
    "good" TEXT[],
    "bad" TEXT[],
    "sortIndex" INTEGER NOT NULL DEFAULT 0,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "Affiliate_pkey" PRIMARY KEY ("id")
);
