18 lines
517 B
SQL
18 lines
517 B
SQL
-- 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 DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT "territory_pkey" PRIMARY KEY ("uuid")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE UNIQUE INDEX "territory_name_key" ON "territory"("name");
|
|
CREATE INDEX "shape_idx" ON "territory" USING GIST ("shape");
|