mirror of
https://gitlab.com/mobicoop/v3/service/territory.git
synced 2025-12-30 20:02:39 +00:00
basic requirements
This commit is contained in:
16
prisma/migrations/20230206113946_init/migration.sql
Normal file
16
prisma/migrations/20230206113946_init/migration.sql
Normal 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");
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal 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
24
prisma/schema.prisma
Normal 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")
|
||||
}
|
||||
Reference in New Issue
Block a user