X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Fdatabase%2FtableStructure.sql;h=ef7547cedcd2907fd3f47929be290d5384568b53;hp=82aedc72a9b0e02c919e11678b7f61a92b4f6e97;hb=46eea3386b6003bd243061cb215196f0f9240c90;hpb=e7f7dbb405adb8f3ea733da746842622b2693c4a diff --git a/src/club/wpia/gigi/database/tableStructure.sql b/src/club/wpia/gigi/database/tableStructure.sql index 82aedc72..ef7547ce 100644 --- a/src/club/wpia/gigi/database/tableStructure.sql +++ b/src/club/wpia/gigi/database/tableStructure.sql @@ -115,16 +115,6 @@ CREATE TABLE "baddomains" ( ); -DROP TABLE IF EXISTS "alerts"; -CREATE TABLE "alerts" ( - "memid" int NOT NULL DEFAULT '0', - "general" boolean NOT NULL DEFAULT 'false', - "country" boolean NOT NULL DEFAULT 'false', - "regional" boolean NOT NULL DEFAULT 'false', - "radius" boolean NOT NULL DEFAULT 'false', - PRIMARY KEY ("memid") -); - DROP TABLE IF EXISTS "user_agreements"; CREATE TABLE "user_agreements" ( "id" serial NOT NULL, @@ -173,6 +163,7 @@ CREATE TABLE "certs" ( "pkhash" char(40) DEFAULT NULL, "certhash" char(40) DEFAULT NULL, "description" varchar(100) NOT NULL DEFAULT '', + "actorid" int NOT NULL, PRIMARY KEY ("id") ); CREATE INDEX ON "certs" ("pkhash"); @@ -181,6 +172,7 @@ CREATE INDEX ON "certs" ("created"); CREATE INDEX ON "certs" ("memid"); CREATE INDEX ON "certs" ("serial"); CREATE INDEX ON "certs" ("expire"); +CREATE INDEX ON "certs" ("actorid"); DROP TABLE IF EXISTS "certAvas"; CREATE TABLE "certAvas" ( @@ -380,7 +372,7 @@ CREATE TABLE "schemeVersion" ( "version" smallint NOT NULL, PRIMARY KEY ("version") ); -INSERT INTO "schemeVersion" (version) VALUES(35); +INSERT INTO "schemeVersion" (version) VALUES(38); DROP TABLE IF EXISTS `passwordResetTickets`; CREATE TABLE `passwordResetTickets` ( @@ -706,3 +698,22 @@ CREATE TABLE "jobLog" ( PRIMARY KEY ("jobid", "attempt") ); CREATE INDEX ON "jobLog" ("jobid"); + +DROP TABLE IF EXISTS "user_contracts"; +DROP TYPE IF EXISTS "contractType"; +CREATE TYPE "contractType" AS ENUM ('RA Agent Contract', 'Org RA Agent Contract'); + +CREATE TABLE "user_contracts" ( + "id" serial NOT NULL, + "token" varchar(32) NOT NULL, + "memid" int NOT NULL, + "document" "contractType" NOT NULL, + "agentname" varchar(255) NOT NULL, + "datesigned" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + "daterevoked" timestamp DEFAULT NULL, + PRIMARY KEY ("id") +); +CREATE INDEX ON "user_contracts" ("memid"); +CREATE INDEX ON "user_contracts" ("document"); +CREATE INDEX ON "user_contracts" ("datesigned"); +CREATE INDEX ON "user_contracts" ("daterevoked");