2023-02-06 12:50:07 +00:00
|
|
|
-- 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,
|
2023-02-08 11:19:52 +00:00
|
|
|
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
2023-02-06 12:50:07 +00:00
|
|
|
|
|
|
|
CONSTRAINT "territory_pkey" PRIMARY KEY ("uuid")
|
|
|
|
);
|
|
|
|
|
|
|
|
-- CreateIndex
|
2023-02-07 13:06:24 +00:00
|
|
|
CREATE UNIQUE INDEX "territory_name_key" ON "territory"("name");
|
2023-02-06 12:50:07 +00:00
|
|
|
CREATE INDEX "shape_idx" ON "territory" USING GIST ("shape");
|