forked from grandchamp/Identity.Dapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIdentityTablesPostgreSql.sql
100 lines (91 loc) · 2.74 KB
/
IdentityTablesPostgreSql.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
CREATE SCHEMA dbo
-- Table: dbo."IdentityUser"
CREATE TABLE dbo."IdentityUser"
(
"UserName" character varying(256) NOT NULL,
"Email" character varying(256) NOT NULL,
"EmailConfirmed" boolean NOT NULL,
"PasswordHash" text,
"SecurityStamp" character varying(38),
"PhoneNumber" character varying(50),
"PhoneNumberConfirmed" boolean,
"TwoFactorEnabled" boolean NOT NULL,
"LockoutEnd" timestamp without time zone,
"LockoutEnabled" boolean NOT NULL,
"AccessFailedCount" integer NOT NULL,
"Id" serial NOT NULL,
CONSTRAINT "PK_IdentityUser" PRIMARY KEY ("Id")
)
WITH (
OIDS=FALSE
);
-- Table: dbo."IdentityRole"
CREATE TABLE dbo."IdentityRole"
(
"Id" serial NOT NULL,
"Name" character varying(50) NOT NULL,
CONSTRAINT "IdentityRole_pkey" PRIMARY KEY ("Id")
)
WITH (
OIDS=FALSE
);
-- Table: dbo."IdentityLogin"
CREATE TABLE dbo."IdentityLogin"
(
"LoginProvider" character varying(256) NOT NULL,
"ProviderKey" character varying(128) NOT NULL,
"UserId" integer NOT NULL,
"Name" character varying(256) NOT NULL,
CONSTRAINT "IdentityLogin_pkey" PRIMARY KEY ("LoginProvider", "ProviderKey", "UserId"),
CONSTRAINT "IdentityLogin_UserId_fkey" FOREIGN KEY ("UserId")
REFERENCES dbo."IdentityUser" ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
-- Table: dbo."IdentityUserClaim"
CREATE TABLE dbo."IdentityUserClaim"
(
"Id" serial NOT NULL,
"UserId" integer NOT NULL,
"ClaimType" character varying(256) NOT NULL,
"ClaimValue" character varying(256) NOT NULL,
CONSTRAINT "IdentityUserClaim_pkey" PRIMARY KEY ("Id"),
CONSTRAINT "IdentityUserClaim_UserId_fkey" FOREIGN KEY ("UserId")
REFERENCES dbo."IdentityUser" ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
-- Table: dbo."IdentityUserRole"
CREATE TABLE dbo."IdentityUserRole"
(
"UserId" integer NOT NULL,
"RoleId" integer NOT NULL,
CONSTRAINT "IdentityUserRole_pkey" PRIMARY KEY ("UserId", "RoleId"),
CONSTRAINT "IdentityUserRole_RoleId_fkey" FOREIGN KEY ("RoleId")
REFERENCES dbo."IdentityRole" ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "IdentityUserRole_UserId_fkey" FOREIGN KEY ("UserId")
REFERENCES dbo."IdentityUser" ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);
CREATE TABLE dbo."IdentityRoleClaim"
(
"Id" serial NOT NULL,
"RoleId" integer NOT NULL,
"ClaimType" character varying(256) NOT NULL,
"ClaimValue" character varying(256),
CONSTRAINT "IdentityRoleClaim_pkey" PRIMARY KEY ("Id"),
CONSTRAINT "IdentityRoleClaim_RoleId_fkey" FOREIGN KEY ("RoleId")
REFERENCES dbo."IdentityRole" ("Id") MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
OIDS=FALSE
);