-- CreateTable
CREATE TABLE "Year" (
    "year" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT
);

-- CreateTable
CREATE TABLE "Person" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "name" TEXT NOT NULL,
    "yearId" INTEGER NOT NULL,
    CONSTRAINT "Person_yearId_fkey" FOREIGN KEY ("yearId") REFERENCES "Year" ("year") ON DELETE RESTRICT ON UPDATE CASCADE
);

-- CreateTable
CREATE TABLE "Gift" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "name" TEXT NOT NULL,
    "url" TEXT,
    "description" TEXT,
    "price" REAL,
    "status" TEXT NOT NULL DEFAULT 'PLANNED',
    "personId" INTEGER NOT NULL,
    CONSTRAINT "Gift_personId_fkey" FOREIGN KEY ("personId") REFERENCES "Person" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
