Api/Berizco.Repository/Migrations/20230920133908_Init.cs

779 lines
37 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Brizco.Repository.Migrations
{
/// <inheritdoc />
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "public");
migrationBuilder.CreateTable(
name: "Complexes",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Address = table.Column<string>(type: "text", nullable: false),
SupportPhone = table.Column<string>(type: "text", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Complexes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Users",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
FirstName = table.Column<string>(type: "text", nullable: false),
LastName = table.Column<string>(type: "text", nullable: false),
InternationalId = table.Column<string>(type: "text", nullable: false),
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Gender = table.Column<int>(type: "integer", nullable: false),
SignUpStatus = table.Column<int>(type: "integer", nullable: false),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Users", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Roles",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
EnglishName = table.Column<string>(type: "text", nullable: false),
PersianName = table.Column<string>(type: "text", nullable: false),
ComplexId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Roles", x => x.Id);
table.ForeignKey(
name: "FK_Roles_Complexes_ComplexId",
column: x => x.ComplexId,
principalSchema: "public",
principalTable: "Complexes",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Shifts",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
StartAt = table.Column<TimeSpan>(type: "interval", nullable: false),
EndAt = table.Column<TimeSpan>(type: "interval", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
ComplexId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Shifts", x => x.Id);
table.ForeignKey(
name: "FK_Shifts_Complexes_ComplexId",
column: x => x.ComplexId,
principalSchema: "public",
principalTable: "Complexes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Tasks",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Type = table.Column<int>(type: "integer", nullable: false),
Title = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: false),
IsRelatedToShift = table.Column<bool>(type: "boolean", nullable: false),
IsRelatedToRole = table.Column<bool>(type: "boolean", nullable: false),
IsRelatedToPerson = table.Column<bool>(type: "boolean", nullable: false),
IsDisposable = table.Column<bool>(type: "boolean", nullable: false),
SetFor = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
HasDisposed = table.Column<bool>(type: "boolean", nullable: false),
ComplexId = table.Column<Guid>(type: "uuid", nullable: false),
Amount = table.Column<int>(type: "integer", nullable: false),
AmountType = table.Column<int>(type: "integer", nullable: false),
Discriminator = table.Column<string>(type: "text", nullable: false),
Status = table.Column<int>(type: "integer", nullable: true),
DoneAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
IsDone = table.Column<bool>(type: "boolean", nullable: true),
PerformanceDescription = table.Column<string>(type: "text", nullable: true),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Tasks", x => x.Id);
table.ForeignKey(
name: "FK_Tasks_Complexes_ComplexId",
column: x => x.ComplexId,
principalSchema: "public",
principalTable: "Complexes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Claims",
schema: "public",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Claims", x => x.Id);
table.ForeignKey(
name: "FK_Claims_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ComplexUsers",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
ComplexId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ComplexUsers", x => x.Id);
table.ForeignKey(
name: "FK_ComplexUsers_Complexes_ComplexId",
column: x => x.ComplexId,
principalSchema: "public",
principalTable: "Complexes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_ComplexUsers_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Logins",
schema: "public",
columns: table => new
{
LoginProvider = table.Column<string>(type: "text", nullable: false),
ProviderKey = table.Column<string>(type: "text", nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_Logins_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "Tokens",
schema: "public",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
LoginProvider = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_Tokens_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "RoleClaims",
schema: "public",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_RoleClaims_Roles_RoleId",
column: x => x.RoleId,
principalSchema: "public",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "UserRoles",
schema: "public",
columns: table => new
{
UserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_UserRoles_Roles_RoleId",
column: x => x.RoleId,
principalSchema: "public",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_UserRoles_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ShiftDays",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DayOfWeek = table.Column<int>(type: "integer", nullable: false),
ShiftId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ShiftDays", x => x.Id);
table.ForeignKey(
name: "FK_ShiftDays_Shifts_ShiftId",
column: x => x.ShiftId,
principalSchema: "public",
principalTable: "Shifts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ShiftPlans",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
StartAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
EndAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ShiftId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ShiftPlans", x => x.Id);
table.ForeignKey(
name: "FK_ShiftPlans_Shifts_ShiftId",
column: x => x.ShiftId,
principalSchema: "public",
principalTable: "Shifts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "TaskRoles",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
TaskId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskRoles", x => x.Id);
table.ForeignKey(
name: "FK_TaskRoles_Roles_RoleId",
column: x => x.RoleId,
principalSchema: "public",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_TaskRoles_Tasks_TaskId",
column: x => x.TaskId,
principalSchema: "public",
principalTable: "Tasks",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "TaskShifts",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
TaskId = table.Column<Guid>(type: "uuid", nullable: false),
ShiftId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskShifts", x => x.Id);
table.ForeignKey(
name: "FK_TaskShifts_Shifts_ShiftId",
column: x => x.ShiftId,
principalSchema: "public",
principalTable: "Shifts",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_TaskShifts_Tasks_TaskId",
column: x => x.TaskId,
principalSchema: "public",
principalTable: "Tasks",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "TaskUsers",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
UserId = table.Column<Guid>(type: "uuid", nullable: false),
TaskId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_TaskUsers", x => x.Id);
table.ForeignKey(
name: "FK_TaskUsers_Tasks_TaskId",
column: x => x.TaskId,
principalSchema: "public",
principalTable: "Tasks",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_TaskUsers_Users_UserId",
column: x => x.UserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ComplexUserRoles",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ComplexUserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ComplexUserRoles", x => x.Id);
table.ForeignKey(
name: "FK_ComplexUserRoles_ComplexUsers_ComplexUserId",
column: x => x.ComplexUserId,
principalSchema: "public",
principalTable: "ComplexUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_ComplexUserRoles_Roles_RoleId",
column: x => x.RoleId,
principalSchema: "public",
principalTable: "Roles",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "ShiftPlanUsers",
schema: "public",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
ShiftPlanId = table.Column<Guid>(type: "uuid", nullable: false),
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
CreatedBy = table.Column<string>(type: "text", nullable: false),
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
RemovedBy = table.Column<string>(type: "text", nullable: false),
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
ModifiedBy = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ShiftPlanUsers", x => x.Id);
table.ForeignKey(
name: "FK_ShiftPlanUsers_ShiftPlans_ShiftPlanId",
column: x => x.ShiftPlanId,
principalSchema: "public",
principalTable: "ShiftPlans",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_ShiftPlanUsers_Users_ApplicationUserId",
column: x => x.ApplicationUserId,
principalSchema: "public",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_Claims_UserId",
schema: "public",
table: "Claims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_ComplexUserRoles_ComplexUserId",
schema: "public",
table: "ComplexUserRoles",
column: "ComplexUserId");
migrationBuilder.CreateIndex(
name: "IX_ComplexUserRoles_RoleId",
schema: "public",
table: "ComplexUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_ComplexUsers_ComplexId",
schema: "public",
table: "ComplexUsers",
column: "ComplexId");
migrationBuilder.CreateIndex(
name: "IX_ComplexUsers_UserId",
schema: "public",
table: "ComplexUsers",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_Logins_UserId",
schema: "public",
table: "Logins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_RoleClaims_RoleId",
schema: "public",
table: "RoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_Roles_ComplexId",
schema: "public",
table: "Roles",
column: "ComplexId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
schema: "public",
table: "Roles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ShiftDays_ShiftId",
schema: "public",
table: "ShiftDays",
column: "ShiftId");
migrationBuilder.CreateIndex(
name: "IX_ShiftPlans_ShiftId",
schema: "public",
table: "ShiftPlans",
column: "ShiftId");
migrationBuilder.CreateIndex(
name: "IX_ShiftPlanUsers_ApplicationUserId",
schema: "public",
table: "ShiftPlanUsers",
column: "ApplicationUserId");
migrationBuilder.CreateIndex(
name: "IX_ShiftPlanUsers_ShiftPlanId",
schema: "public",
table: "ShiftPlanUsers",
column: "ShiftPlanId");
migrationBuilder.CreateIndex(
name: "IX_Shifts_ComplexId",
schema: "public",
table: "Shifts",
column: "ComplexId");
migrationBuilder.CreateIndex(
name: "IX_TaskRoles_RoleId",
schema: "public",
table: "TaskRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_TaskRoles_TaskId",
schema: "public",
table: "TaskRoles",
column: "TaskId");
migrationBuilder.CreateIndex(
name: "IX_Tasks_ComplexId",
schema: "public",
table: "Tasks",
column: "ComplexId");
migrationBuilder.CreateIndex(
name: "IX_TaskShifts_ShiftId",
schema: "public",
table: "TaskShifts",
column: "ShiftId");
migrationBuilder.CreateIndex(
name: "IX_TaskShifts_TaskId",
schema: "public",
table: "TaskShifts",
column: "TaskId");
migrationBuilder.CreateIndex(
name: "IX_TaskUsers_TaskId",
schema: "public",
table: "TaskUsers",
column: "TaskId");
migrationBuilder.CreateIndex(
name: "IX_TaskUsers_UserId",
schema: "public",
table: "TaskUsers",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_UserRoles_RoleId",
schema: "public",
table: "UserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
schema: "public",
table: "Users",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
schema: "public",
table: "Users",
column: "NormalizedUserName",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Claims",
schema: "public");
migrationBuilder.DropTable(
name: "ComplexUserRoles",
schema: "public");
migrationBuilder.DropTable(
name: "Logins",
schema: "public");
migrationBuilder.DropTable(
name: "RoleClaims",
schema: "public");
migrationBuilder.DropTable(
name: "ShiftDays",
schema: "public");
migrationBuilder.DropTable(
name: "ShiftPlanUsers",
schema: "public");
migrationBuilder.DropTable(
name: "TaskRoles",
schema: "public");
migrationBuilder.DropTable(
name: "TaskShifts",
schema: "public");
migrationBuilder.DropTable(
name: "TaskUsers",
schema: "public");
migrationBuilder.DropTable(
name: "Tokens",
schema: "public");
migrationBuilder.DropTable(
name: "UserRoles",
schema: "public");
migrationBuilder.DropTable(
name: "ComplexUsers",
schema: "public");
migrationBuilder.DropTable(
name: "ShiftPlans",
schema: "public");
migrationBuilder.DropTable(
name: "Tasks",
schema: "public");
migrationBuilder.DropTable(
name: "Roles",
schema: "public");
migrationBuilder.DropTable(
name: "Users",
schema: "public");
migrationBuilder.DropTable(
name: "Shifts",
schema: "public");
migrationBuilder.DropTable(
name: "Complexes",
schema: "public");
}
}
}