Skip to content

Commit

Permalink
SQL Fields Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
robson-paproski committed Dec 27, 2015
1 parent 89cdbe2 commit d245bdf
Showing 1 changed file with 63 additions and 22 deletions.
85 changes: 63 additions & 22 deletions src/AspNetIdentity3PostgreSQL/PostgreSQLIdentity.sql
Original file line number Diff line number Diff line change
@@ -1,47 +1,88 @@
CREATE TABLE "AspNetRoles" (
"Id" varchar(128) NOT NULL,
CREATE TABLE public."AspNetRoles" (
"Id" VARCHAR(128) NOT NULL,
"Name" TEXT NOT NULL,
PRIMARY KEY ("Id")
);
"ConcurrencyStamp" TEXT,
CONSTRAINT "AspNetRoles_pkey" PRIMARY KEY("Id")
)
WITH (oids = false);

CREATE TABLE "AspNetUsers" (
CREATE TABLE public."AspNetUsers" (
"Id" UUID NOT NULL,
"UserName" TEXT NOT NULL,
"PasswordHash" TEXT,
"SecurityStamp" TEXT,
"Email" TEXT DEFAULT NULL,
"EmailConfirmed" boolean NOT NULL DEFAULT false,
"Email" TEXT,
"EmailConfirmed" BOOLEAN DEFAULT false NOT NULL,
"PhoneNumber" TEXT,
"PhoneNumberConfirmed" boolean NOT NULL DEFAULT false,
"TwoFactorEnabled" boolean NOT NULL DEFAULT false,
"LockoutEndDateUtc" timestamptz NULL,
"LockoutEnabled" boolean NOT NULL DEFAULT false,
"AccessFailedCount" INT NOT NULL,
PRIMARY KEY ("Id")
);
"PhoneNumberConfirmed" BOOLEAN DEFAULT false NOT NULL,
"TwoFactorEnabled" BOOLEAN DEFAULT false NOT NULL,
"LockoutEndDateUtc" TIMESTAMP WITH TIME ZONE,
"LockoutEnabled" BOOLEAN DEFAULT false NOT NULL,
"AccessFailedCount" INTEGER NOT NULL,
"ConcurrencyStamp" TEXT,
CONSTRAINT "AspNetUsers_pkey" PRIMARY KEY("Id")
)
WITH (oids = false);


CREATE TABLE "AspNetUserClaims" (
CREATE TABLE public."AspNetUserClaims" (
"Id" SERIAL,
"ClaimType" TEXT NULL,
"ClaimValue" TEXT NULL,
"ClaimType" TEXT,
"ClaimValue" TEXT,
"UserId" UUID NOT NULL,
PRIMARY KEY ("Id")
);
CONSTRAINT "AspNetUserClaims_pkey" PRIMARY KEY("Id"),
CONSTRAINT "FK_AspNetUserClaims_AspNetUsers_User_Id" FOREIGN KEY ("UserId")
REFERENCES public."AspNetUsers"("Id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE
)
WITH (oids = false);

CREATE TABLE "AspNetUserLogins" (

CREATE TABLE public."AspNetUserLogins" (
"UserId" UUID NOT NULL,
"LoginProvider" TEXT NOT NULL,
"ProviderKey" TEXT NOT NULL,
PRIMARY KEY ("UserId", "LoginProvider", "ProviderKey")
);
"ProviderDisplayName" TEXT,
CONSTRAINT "AspNetUserLogins_pkey" PRIMARY KEY("UserId", "LoginProvider", "ProviderKey"),
CONSTRAINT "FK_AspNetUserLogins_AspNetUsers_UserId" FOREIGN KEY ("UserId")
REFERENCES public."AspNetUsers"("Id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE
)
WITH (oids = false);

CREATE TABLE "AspNetUserRoles" (
"UserId" UUID NOT NULL,
"RoleId" varchar(128) NOT NULL,
PRIMARY KEY ("UserId", "RoleId")
);

CREATE TABLE public."AspNetUserRoles" (
"UserId" UUID NOT NULL,
"RoleId" VARCHAR(128) NOT NULL,
CONSTRAINT "AspNetUserRoles_pkey" PRIMARY KEY("UserId", "RoleId"),
CONSTRAINT "FK_AspNetUserRoles_AspNetRoles_RoleId" FOREIGN KEY ("RoleId")
REFERENCES public."AspNetRoles"("Id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE,
CONSTRAINT "FK_AspNetUserRoles_AspNetUsers_UserId" FOREIGN KEY ("UserId")
REFERENCES public."AspNetUsers"("Id")
ON DELETE CASCADE
ON UPDATE NO ACTION
NOT DEFERRABLE
)
WITH (oids = false);

CREATE INDEX "IX_AspNetUserRoles_RoleId" ON public."AspNetUserRoles"
USING btree ("RoleId" COLLATE pg_catalog."default");

CREATE INDEX "IX_AspNetUserRoles_UserId" ON public."AspNetUserRoles"
USING btree ("UserId");

CREATE INDEX "IX_AspNetUserClaims_UserId" ON "AspNetUserClaims" ("UserId");
CREATE INDEX "IX_AspNetUserLogins_UserId" ON "AspNetUserLogins" ("UserId");
CREATE INDEX "IX_AspNetUserRoles_RoleId" ON "AspNetUserRoles" ("RoleId");
Expand Down

0 comments on commit d245bdf

Please sign in to comment.