scraper
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "FoundEvents" (
|
||||
"id" UUID NOT NULL DEFAULT uuidv7(),
|
||||
"source" VARCHAR NOT NULL,
|
||||
"url" VARCHAR NOT NULL,
|
||||
"foundDate" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"eventDate" DATE NOT NULL,
|
||||
"title" VARCHAR NOT NULL,
|
||||
"description" VARCHAR NOT NULL,
|
||||
"attachedFile" BYTEA NOT NULL,
|
||||
|
||||
CONSTRAINT "FoundEvents_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "FoundEvents" ALTER COLUMN "eventDate" DROP NOT NULL,
|
||||
ALTER COLUMN "title" DROP NOT NULL,
|
||||
ALTER COLUMN "description" DROP NOT NULL,
|
||||
ALTER COLUMN "attachedFile" DROP NOT NULL,
|
||||
ALTER COLUMN "attachedFile" SET DATA TYPE VARCHAR;
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `attachedFile` on the `FoundEvents` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "FoundEvents" DROP COLUMN "attachedFile";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "FoundEventAttachments" (
|
||||
"id" UUID NOT NULL DEFAULT uuidv7(),
|
||||
"url" VARCHAR NOT NULL,
|
||||
"eventId" UUID NOT NULL,
|
||||
|
||||
CONSTRAINT "FoundEventAttachments_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "FoundEventAttachments" ADD CONSTRAINT "FoundEventAttachments_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "FoundEvents"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "FoundEvents" ALTER COLUMN "eventDate" SET DATA TYPE VARCHAR;
|
||||
@@ -35,3 +35,21 @@ model session {
|
||||
enum Topic {
|
||||
TEST
|
||||
}
|
||||
|
||||
model FoundEvents {
|
||||
id String @id @default(dbgenerated("uuidv7()")) @db.Uuid
|
||||
source String @db.VarChar
|
||||
url String @db.VarChar
|
||||
foundDate DateTime @db.Date @default(now())
|
||||
eventDate String? @db.VarChar
|
||||
title String? @db.VarChar
|
||||
description String? @db.VarChar
|
||||
attachedFiles FoundEventAttachments[]
|
||||
}
|
||||
|
||||
model FoundEventAttachments {
|
||||
id String @id @default(dbgenerated("uuidv7()")) @db.Uuid
|
||||
url String @db.VarChar
|
||||
event FoundEvents @relation(fields: [eventId], references: [id])
|
||||
eventId String @db.Uuid
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user