basic requirements

This commit is contained in:
sbriat
2023-02-06 13:50:07 +01:00
parent bb5cd96bd9
commit a743fefe94
68 changed files with 18879 additions and 73 deletions

View File

@@ -0,0 +1,16 @@
-- CreateExtension
CREATE EXTENSION IF NOT EXISTS "postgis";
-- CreateTable
CREATE TABLE "territory" (
"uuid" UUID NOT NULL,
"name" TEXT NOT NULL,
"shape" geometry NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "territory_pkey" PRIMARY KEY ("uuid")
);
-- CreateIndex
CREATE INDEX "shape_idx" ON "territory" USING GIST ("shape");

View File

@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "postgresql"

24
prisma/schema.prisma Normal file
View File

@@ -0,0 +1,24 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis]
}
model Territory {
uuid String @id @default(uuid()) @db.Uuid
name String
shape Unsupported("geometry")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([shape], name: "shape_idx", type: Gist)
@@map("territory")
}