-- CreateTable CREATE TABLE "Data" ( "id" SERIAL NOT NULL, "desc" VARCHAR NOT NULL DEFAULT '', "img" VARCHAR NOT NULL DEFAULT '/Pjob.jpb', "time" VARCHAR NOT NULL DEFAULT '', "pay" INTEGER NOT NULL DEFAULT 1, CONSTRAINT "Data_pkey" PRIMARY KEY ("id") ); -- CreateTable CREATE TABLE "Job" ( "id" SERIAL NOT NULL, "name" VARCHAR NOT NULL, "worktime" VARCHAR NOT NULL, "createTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updateTime" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "pin" BOOLEAN NOT NULL DEFAULT true, "dataId" INTEGER, "place" VARCHAR NOT NULL DEFAULT 'in', "area" VARCHAR NOT NULL DEFAULT 'in', CONSTRAINT "Job_pkey" PRIMARY KEY ("id") ); -- CreateIndex CREATE UNIQUE INDEX "Job_dataId_key" ON "Job"("dataId"); -- AddForeignKey ALTER TABLE "Job" ADD CONSTRAINT "Job_dataId_fkey" FOREIGN KEY ("dataId") REFERENCES "Data"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;