17 lines
426 B
MySQL
17 lines
426 B
MySQL
|
-- 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");
|