97 lines
3.5 KiB
MySQL
97 lines
3.5 KiB
MySQL
|
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
|
||
|
"MigrationId" character varying(150) NOT NULL,
|
||
|
"ProductVersion" character varying(32) NOT NULL,
|
||
|
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
|
||
|
);
|
||
|
|
||
|
START TRANSACTION;
|
||
|
|
||
|
CREATE TABLE "AspNetRoles" (
|
||
|
"Id" text NOT NULL,
|
||
|
"Name" character varying(256),
|
||
|
"NormalizedName" character varying(256),
|
||
|
"ConcurrencyStamp" text,
|
||
|
CONSTRAINT "PK_AspNetRoles" PRIMARY KEY ("Id")
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetUsers" (
|
||
|
"Id" text NOT NULL,
|
||
|
"UserName" character varying(256),
|
||
|
"NormalizedUserName" character varying(256),
|
||
|
"Email" character varying(256),
|
||
|
"NormalizedEmail" character varying(256),
|
||
|
"EmailConfirmed" boolean NOT NULL,
|
||
|
"PasswordHash" text,
|
||
|
"SecurityStamp" text,
|
||
|
"ConcurrencyStamp" text,
|
||
|
"PhoneNumber" text,
|
||
|
"PhoneNumberConfirmed" boolean NOT NULL,
|
||
|
"TwoFactorEnabled" boolean NOT NULL,
|
||
|
"LockoutEnd" timestamp with time zone,
|
||
|
"LockoutEnabled" boolean NOT NULL,
|
||
|
"AccessFailedCount" integer NOT NULL,
|
||
|
CONSTRAINT "PK_AspNetUsers" PRIMARY KEY ("Id")
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetRoleClaims" (
|
||
|
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
|
||
|
"RoleId" text NOT NULL,
|
||
|
"ClaimType" text,
|
||
|
"ClaimValue" text,
|
||
|
CONSTRAINT "PK_AspNetRoleClaims" PRIMARY KEY ("Id"),
|
||
|
CONSTRAINT "FK_AspNetRoleClaims_AspNetRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AspNetRoles" ("Id") ON DELETE CASCADE
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetUserClaims" (
|
||
|
"Id" integer GENERATED BY DEFAULT AS IDENTITY,
|
||
|
"UserId" text NOT NULL,
|
||
|
"ClaimType" text,
|
||
|
"ClaimValue" text,
|
||
|
CONSTRAINT "PK_AspNetUserClaims" PRIMARY KEY ("Id"),
|
||
|
CONSTRAINT "FK_AspNetUserClaims_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id") ON DELETE CASCADE
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetUserLogins" (
|
||
|
"LoginProvider" text NOT NULL,
|
||
|
"ProviderKey" text NOT NULL,
|
||
|
"ProviderDisplayName" text,
|
||
|
"UserId" text NOT NULL,
|
||
|
CONSTRAINT "PK_AspNetUserLogins" PRIMARY KEY ("LoginProvider", "ProviderKey"),
|
||
|
CONSTRAINT "FK_AspNetUserLogins_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id") ON DELETE CASCADE
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetUserRoles" (
|
||
|
"UserId" text NOT NULL,
|
||
|
"RoleId" text NOT NULL,
|
||
|
CONSTRAINT "PK_AspNetUserRoles" PRIMARY KEY ("UserId", "RoleId"),
|
||
|
CONSTRAINT "FK_AspNetUserRoles_AspNetRoles_RoleId" FOREIGN KEY ("RoleId") REFERENCES "AspNetRoles" ("Id") ON DELETE CASCADE,
|
||
|
CONSTRAINT "FK_AspNetUserRoles_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id") ON DELETE CASCADE
|
||
|
);
|
||
|
|
||
|
CREATE TABLE "AspNetUserTokens" (
|
||
|
"UserId" text NOT NULL,
|
||
|
"LoginProvider" text NOT NULL,
|
||
|
"Name" text NOT NULL,
|
||
|
"Value" text,
|
||
|
CONSTRAINT "PK_AspNetUserTokens" PRIMARY KEY ("UserId", "LoginProvider", "Name"),
|
||
|
CONSTRAINT "FK_AspNetUserTokens_AspNetUsers_UserId" FOREIGN KEY ("UserId") REFERENCES "AspNetUsers" ("Id") ON DELETE CASCADE
|
||
|
);
|
||
|
|
||
|
CREATE INDEX "IX_AspNetRoleClaims_RoleId" ON "AspNetRoleClaims" ("RoleId");
|
||
|
|
||
|
CREATE UNIQUE INDEX "RoleNameIndex" ON "AspNetRoles" ("NormalizedName");
|
||
|
|
||
|
CREATE INDEX "IX_AspNetUserClaims_UserId" ON "AspNetUserClaims" ("UserId");
|
||
|
|
||
|
CREATE INDEX "IX_AspNetUserLogins_UserId" ON "AspNetUserLogins" ("UserId");
|
||
|
|
||
|
CREATE INDEX "IX_AspNetUserRoles_RoleId" ON "AspNetUserRoles" ("RoleId");
|
||
|
|
||
|
CREATE INDEX "EmailIndex" ON "AspNetUsers" ("NormalizedEmail");
|
||
|
|
||
|
CREATE UNIQUE INDEX "UserNameIndex" ON "AspNetUsers" ("NormalizedUserName");
|
||
|
|
||
|
INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion")
|
||
|
VALUES ('20240206125053_Init', '8.0.1');
|
||
|
|
||
|
COMMIT;
|