   CONSTRAINT "usersposmatchids_ibfk_1" FOREIGN KEY ("username") REFERENCES "users" ("username"),
   CONSTRAINT "usersposmatchids_ibfk_2" FOREIGN KEY ("posmatchid") REFERENCES "posmatchids" ("posmatchid") ON DELETE CASCADE
 );
-create index "usersposmatchids_idx1" on "usersposmatchids"("eqdiff");
-create index "username" on "usersposmatchids"("username");
+create index if not exists "usersposmatchids_idx1" on "usersposmatchids"("eqdiff");
+create index if not exists "username" on "usersposmatchids"("username");

  UNIQUE ("posmatchid","move"),
  CONSTRAINT "anposmatchid" FOREIGN KEY ("posmatchid") REFERENCES "posmatchids" ("posmatchid") ON DELETE CASCADE
);
create index "anposmatchid_idx" on "analyses"("posmatchid");

CREATE TABLE "comments" (
  "id" integer primary key,
  "username" varchar(50) NOT NULL,
  "posmatchid" char(27) DEFAULT NULL,

  CONSTRAINT "usern_fk" FOREIGN KEY ("username") REFERENCES "users" ("username") ON DELETE NO ACTION ON UPDATE NO ACTION
);

CREATE TABLE if not exists "reports"(
  "id" integer primary key,
  "username" varchar(50) NOT NULL,
  "posmatchid" char(27) DEFAULT NULL,
