Reset Migation Files

This commit is contained in:
Vikas Nale 2025-03-26 11:20:48 +05:30
parent 0ea14ff112
commit 79753c33d3
39 changed files with 332 additions and 35588 deletions

View File

@ -32,4 +32,8 @@
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" /> <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>
</Project> </Project>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,278 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class role : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Feature_Tenants_TenantId",
table: "Feature");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
table: "FeaturePermission");
migrationBuilder.DropIndex(
name: "IX_FeaturePermission_RoleId",
table: "FeaturePermission");
migrationBuilder.DropIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission");
migrationBuilder.DropPrimaryKey(
name: "PK_Feature",
table: "Feature");
migrationBuilder.DropColumn(
name: "RoleId",
table: "FeaturePermission");
migrationBuilder.RenameTable(
name: "Feature",
newName: "Features");
migrationBuilder.RenameIndex(
name: "IX_Feature_TenantId",
table: "Features",
newName: "IX_Features_TenantId");
migrationBuilder.AddColumn<bool>(
name: "AllowCreate",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowDelete",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowModify",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowView",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "EmployeeRoles",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<Guid>(
name: "EmployeeRoleId",
table: "Features",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Features",
table: "Features",
column: "Id");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("62e0918d-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("68823f1f-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.UpdateData(
table: "EmployeeRoles",
keyColumn: "Id",
keyValue: new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"),
column: "Description",
value: "");
migrationBuilder.CreateIndex(
name: "IX_Features_EmployeeRoleId",
table: "Features",
column: "EmployeeRoleId");
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_EmployeeRoles_EmployeeRoleId",
table: "Features",
column: "EmployeeRoleId",
principalTable: "EmployeeRoles",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_Features_EmployeeRoles_EmployeeRoleId",
table: "Features");
migrationBuilder.DropForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features");
migrationBuilder.DropPrimaryKey(
name: "PK_Features",
table: "Features");
migrationBuilder.DropIndex(
name: "IX_Features_EmployeeRoleId",
table: "Features");
migrationBuilder.DropColumn(
name: "AllowCreate",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowDelete",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowModify",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowView",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "Description",
table: "EmployeeRoles");
migrationBuilder.DropColumn(
name: "EmployeeRoleId",
table: "Features");
migrationBuilder.RenameTable(
name: "Features",
newName: "Feature");
migrationBuilder.RenameIndex(
name: "IX_Features_TenantId",
table: "Feature",
newName: "IX_Feature_TenantId");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "FeaturePermission",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Feature",
table: "Feature",
column: "Id");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_RoleId",
table: "FeaturePermission",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Feature_Tenants_TenantId",
table: "Feature",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
table: "FeaturePermission",
column: "RoleId",
principalTable: "EmployeeRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Feature",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
table: "FeaturePermission",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,416 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addFeatures : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission");
migrationBuilder.DropForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features");
migrationBuilder.DropPrimaryKey(
name: "PK_FeaturePermission",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowCreate",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowDelete",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowModify",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "AllowView",
table: "FeaturePermission");
migrationBuilder.DropColumn(
name: "TenantId",
table: "FeaturePermission");
migrationBuilder.RenameTable(
name: "FeaturePermission",
newName: "FeaturePermissions");
migrationBuilder.RenameColumn(
name: "TenantId",
table: "Features",
newName: "ModuleId");
migrationBuilder.RenameIndex(
name: "IX_Features_TenantId",
table: "Features",
newName: "IX_Features_ModuleId");
migrationBuilder.RenameIndex(
name: "IX_FeaturePermission_FeatureId",
table: "FeaturePermissions",
newName: "IX_FeaturePermissions_FeatureId");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Features",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "Description",
table: "FeaturePermissions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<string>(
name: "Name",
table: "FeaturePermissions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddPrimaryKey(
name: "PK_FeaturePermissions",
table: "FeaturePermissions",
column: "Id");
migrationBuilder.CreateTable(
name: "Modules",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Modules", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "Modules",
columns: new[] { "Id", "Description", "Key", "Name" },
values: new object[,]
{
{ 1, "Project Module", "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c", "Project" },
{ 2, "Employee Module", "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc", "Employee" },
{ 3, "Masters Module", "e6423995-d7bf-452e-8bcc-780a655b015c", "Masters" }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "EmployeeRoleId", "IsActive", "ModuleId", "Name" },
values: new object[,]
{
{ new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", null, true, 1, "Assign and Update Tasks Progress" },
{ new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", null, true, 2, "Attendance" },
{ new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", null, true, 1, "Manage Project" },
{ new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", null, true, 3, "Tenant Masters" },
{ new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", null, true, 2, "Manage Employee" },
{ new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", null, true, 1, "Manage Infra" },
{ new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", null, true, 1, "Manage Tasks" },
{ new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", null, true, 3, "Global Masters" }
});
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" },
{ new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" },
{ new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" },
{ new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" },
{ new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" },
{ new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" },
{ new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" },
{ new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " },
{ new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" },
{ new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" },
{ new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" },
{ new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" },
{ new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" },
{ new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" },
{ new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign Task and Report Progress" },
{ new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Approve Task" },
{ new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" },
{ new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" }
});
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
table: "FeaturePermissions",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_Modules_ModuleId",
table: "Features",
column: "ModuleId",
principalTable: "Modules",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
table: "FeaturePermissions");
migrationBuilder.DropForeignKey(
name: "FK_Features_Modules_ModuleId",
table: "Features");
migrationBuilder.DropTable(
name: "Modules");
migrationBuilder.DropPrimaryKey(
name: "PK_FeaturePermissions",
table: "FeaturePermissions");
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("588a8824-f924-4955-82d8-fc51956cf323"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("a97d366a-c2bb-448d-be93-402bd2324566"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("f2aee20a-b754-4537-8166-f9507b44585b"));
migrationBuilder.DeleteData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"));
migrationBuilder.DeleteData(
table: "Features",
keyColumn: "Id",
keyValue: new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"));
migrationBuilder.DropColumn(
name: "IsActive",
table: "Features");
migrationBuilder.DropColumn(
name: "Description",
table: "FeaturePermissions");
migrationBuilder.DropColumn(
name: "Name",
table: "FeaturePermissions");
migrationBuilder.RenameTable(
name: "FeaturePermissions",
newName: "FeaturePermission");
migrationBuilder.RenameColumn(
name: "ModuleId",
table: "Features",
newName: "TenantId");
migrationBuilder.RenameIndex(
name: "IX_Features_ModuleId",
table: "Features",
newName: "IX_Features_TenantId");
migrationBuilder.RenameIndex(
name: "IX_FeaturePermissions_FeatureId",
table: "FeaturePermission",
newName: "IX_FeaturePermission_FeatureId");
migrationBuilder.AddColumn<bool>(
name: "AllowCreate",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowDelete",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowModify",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "AllowView",
table: "FeaturePermission",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "TenantId",
table: "FeaturePermission",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddPrimaryKey(
name: "PK_FeaturePermission",
table: "FeaturePermission",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_FeaturePermission_Features_FeatureId",
table: "FeaturePermission",
column: "FeatureId",
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Features_Tenants_TenantId",
table: "Features",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class featuremapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "73f5248b-c0d7-49de-a045-3617339c94cd");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "35fd0032-dfb1-44a4-931c-b9417ec406e7");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "adccb225-5824-4b96-96f8-d28143c42475");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "9a7ed07c-f7dd-4831-bf64-d5278fa9e38c");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "a9fb08bf-7dae-4282-9b02-f63d94d7a9dc");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "e6423995-d7bf-452e-8bcc-780a655b015c");
}
}
}

View File

@ -1,73 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class NoNavigationMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.AddColumn<Guid>(
// name: "RoleId",
// table: "Employees",
// type: "char(36)",
// nullable: false,
// defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
// collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d522bcb3-6965-4c2f-be14-dd18b3181a34");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "77302f42-93ec-49eb-9e05-80b80939639a");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "RoleId",
// table: "Employees");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "03f97e79-e7ff-412b-91b4-19b71325f00c");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "2351d591-bdd5-4eb5-a375-125c8cfdcf29");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "bedbed6b-8ea5-4bd2-a37c-d5454d0dd280");
}
}
}

View File

@ -1,89 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class updatefeaturesmaster : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"),
column: "FeatureId",
value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"),
column: "FeatureId",
value: new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"));
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "19101abd-012e-4809-b153-da6bdbca0d7a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"),
column: "FeatureId",
value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.UpdateData(
table: "FeaturePermissions",
keyColumn: "Id",
keyValue: new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"),
column: "FeatureId",
value: new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"));
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b29e3352-d83f-42eb-9c57-6e2cbf1b7c9b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d522bcb3-6965-4c2f-be14-dd18b3181a34");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "77302f42-93ec-49eb-9e05-80b80939639a");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class mapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "eec3cf92-01c2-41a2-bfc1-f3c2af318848");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a22bf2f-e8f0-4164-aedc-307b370b4ef6");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "69a68bf1-30e7-45fc-ab75-0c11ea10bfc3");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b0aa1d10-7b8a-40f1-96b3-219e8de89ccb");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "19101abd-012e-4809-b153-da6bdbca0d7a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0cb9a301-edf2-4a15-8eeb-5bfea0ad4d90");
}
}
}

View File

@ -1,139 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class RolePermissionMappings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ApplicationRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Role = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApplicationRoles", x => x.Id);
table.ForeignKey(
name: "FK_ApplicationRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RolePermissionMappings",
columns: table => new
{
ApplicationRoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeaturePermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId });
table.ForeignKey(
name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId",
column: x => x.ApplicationRoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId",
column: x => x.FeaturePermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "ApplicationRoles",
columns: new[] { "Id", "Description", "Role", "TenantId" },
values: new object[,]
{
{ new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 },
{ new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 },
{ new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 },
{ new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 },
{ new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 }
});
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "286516c2-0d55-439c-a8fa-b6858735ef65");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "c38971e1-491e-479f-9d02-54634c0b4908");
migrationBuilder.CreateIndex(
name: "IX_ApplicationRoles_TenantId",
table: "ApplicationRoles",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_RolePermissionMappings_FeaturePermissionId",
table: "RolePermissionMappings",
column: "FeaturePermissionId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "RolePermissionMappings");
migrationBuilder.DropTable(
name: "ApplicationRoles");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "235d7bb6-9fae-4cdc-bc62-2426059cd49e");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "e60119bf-48b1-4534-82ae-88d23ae46f15");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "9090b0dd-7a3c-46f7-82e5-816eb6c416d2");
}
}
}

View File

@ -1,113 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class EmployeeRolesMapping : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "EmployeeRoleMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId",
column: x => x.RoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_EmployeeId",
table: "EmployeeRoleMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_RoleId",
table: "EmployeeRoleMappings",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_TenantId",
table: "EmployeeRoleMappings",
column: "TenantId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EmployeeRoleMappings");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "286516c2-0d55-439c-a8fa-b6858735ef65");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "6a84b9c0-1478-4d87-9ef6-34c00f0fca4a");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "c38971e1-491e-479f-9d02-54634c0b4908");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,136 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addjobrole : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RoleId",
table: "Employees");
migrationBuilder.AddColumn<int>(
name: "JobRoleId",
table: "Employees",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "JobRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey(
name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "ad9fb730-b80a-446c-bf49-bf41f90e0c0b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "bc153ba8-7f38-4b91-97d5-1deb230250a9");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "44e296ca-5597-44c9-9159-b481c941f902");
migrationBuilder.CreateIndex(
name: "IX_Employees_JobRoleId",
table: "Employees",
column: "JobRoleId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropTable(
name: "JobRoles");
migrationBuilder.DropIndex(
name: "IX_Employees_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "JobRoleId",
table: "Employees");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,136 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class CreateJobRoles : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
//migrationBuilder.DropColumn(
// name: "RoleId",
// table: "Employees");
migrationBuilder.AddColumn<int>(
name: "JobRoleId",
table: "Employees",
type: "int",
nullable: true);
migrationBuilder.CreateTable(
name: "JobRoles",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey(
name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "331a7bea-688e-4f27-8dba-697d9cd29870");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "ba873fd2-277b-4baa-88b9-22b69010ffa8");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47");
migrationBuilder.CreateIndex(
name: "IX_Employees_JobRoleId",
table: "Employees",
column: "JobRoleId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees",
column: "JobRoleId",
principalTable: "JobRoles",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Employees_JobRoles_JobRoleId",
table: "Employees");
migrationBuilder.DropTable(
name: "JobRoles");
migrationBuilder.DropIndex(
name: "IX_Employees_JobRoleId",
table: "Employees");
migrationBuilder.DropColumn(
name: "JobRoleId",
table: "Employees");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "05db8d60-e977-40f6-b944-8602d0d4cb98");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "456ddbbe-0963-406d-8874-589a546c3670");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "19eca67f-c3b1-4e5c-8d95-c8341cf058ae");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,208 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attendancemodule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendanceLogs");
migrationBuilder.CreateTable(
name: "AttendLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_AttendanceId",
table: "AttendLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_EmployeeID",
table: "AttendLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_TenantId",
table: "AttendLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_UpdatedBy",
table: "AttendLogs",
column: "UpdatedBy");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendLogs");
migrationBuilder.CreateTable(
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "9a70d253-1f44-411c-899a-718c344c1aea");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "aff7e2a1-8b98-49ca-a73e-b342a4d7ef90");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "dc33f0de-5730-40b0-b52b-c61ea0176c03");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_TenantId",
table: "AttendanceLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_UpdatedBy",
table: "AttendanceLogs",
column: "UpdatedBy");
}
}
}

View File

@ -1,208 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class renameattendancelogs : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendLogs");
migrationBuilder.CreateTable(
name: "AttendanceLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "e20751cc-a482-499e-98de-ccc88689fcc6");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "589ba09f-e176-4c90-9502-707799d33e94");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "f1c5886a-474c-4b71-bda8-f278b78b0a4d");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_TenantId",
table: "AttendanceLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_UpdatedBy",
table: "AttendanceLogs",
column: "UpdatedBy");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AttendanceLogs");
migrationBuilder.CreateTable(
name: "AttendLogs",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
Activity = table.Column<int>(type: "int", nullable: false),
ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Latitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
Photo = table.Column<byte[]>(type: "longblob", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AttendLogs", x => x.Id);
table.ForeignKey(
name: "FK_AttendLogs_Attendances_AttendanceId",
column: x => x.AttendanceId,
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AttendLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendLogs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "04db13e4-201a-44ba-9d9a-6c07f91d3cd0");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "72e2c008-c3f1-4dd8-a6ed-19c9eec3d892");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "0a8eda0f-39b8-4efe-98af-5c6f2a7cd5cf");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_AttendanceId",
table: "AttendLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_EmployeeID",
table: "AttendLogs",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_TenantId",
table: "AttendLogs",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_AttendLogs_UpdatedBy",
table: "AttendLogs",
column: "UpdatedBy");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,242 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attend : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances");
migrationBuilder.DropForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendances",
table: "Attendances");
migrationBuilder.RenameTable(
name: "Attendances",
newName: "Attendance");
migrationBuilder.RenameIndex(
name: "IX_Attendances_TenantId",
table: "Attendance",
newName: "IX_Attendance_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendances_EmployeeID",
table: "Attendance",
newName: "IX_Attendance_EmployeeID");
migrationBuilder.AddColumn<Guid>(
name: "RoleId",
table: "Employees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendance",
table: "Attendance",
column: "Id");
migrationBuilder.CreateTable(
name: "Attendes",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
EmployeeID = table.Column<int>(type: "int", nullable: false),
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ProjectID = table.Column<int>(type: "int", nullable: false),
AttendanceDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
InTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
OutTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
Activity = table.Column<int>(type: "int", nullable: false),
ApprovedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Attendes", x => x.Id);
table.ForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
column: x => x.EmployeeID,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Attendes_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "c66df186-3191-4286-b5ef-c6a4adc3a65b");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "5efb0b4b-03ab-480c-a2fd-d5a8be9e5f96");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "43e0fb8a-3d42-451c-9899-24bb033b4e70");
migrationBuilder.CreateIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendes",
column: "EmployeeID");
migrationBuilder.CreateIndex(
name: "IX_Attendes_TenantId",
table: "Attendes",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_Attendance_Employees_EmployeeID",
table: "Attendance",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendance_Tenants_TenantId",
table: "Attendance",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendance",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Attendance_Employees_EmployeeID",
table: "Attendance");
migrationBuilder.DropForeignKey(
name: "FK_Attendance_Tenants_TenantId",
table: "Attendance");
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendes");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendance",
table: "Attendance");
migrationBuilder.DropColumn(
name: "RoleId",
table: "Employees");
migrationBuilder.RenameTable(
name: "Attendance",
newName: "Attendances");
migrationBuilder.RenameIndex(
name: "IX_Attendance_TenantId",
table: "Attendances",
newName: "IX_Attendances_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendance_EmployeeID",
table: "Attendances",
newName: "IX_Attendances_EmployeeID");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendances",
table: "Attendances",
column: "Id");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "331a7bea-688e-4f27-8dba-697d9cd29870");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "ba873fd2-277b-4baa-88b9-22b69010ffa8");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "aa481e97-9a9b-4b1e-b9dd-0a6ce26dab47");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,117 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class attendrename : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendance_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropTable(
name: "Attendance");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AttendanceLogs_Attendes_AttendanceId",
table: "AttendanceLogs");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Employees_EmployeeID",
table: "Attendes");
migrationBuilder.DropForeignKey(
name: "FK_Attendes_Tenants_TenantId",
table: "Attendes");
migrationBuilder.DropPrimaryKey(
name: "PK_Attendes",
table: "Attendes");
migrationBuilder.RenameTable(
name: "Attendes",
newName: "Attendances");
migrationBuilder.RenameIndex(
name: "IX_Attendes_TenantId",
table: "Attendances",
newName: "IX_Attendances_TenantId");
migrationBuilder.RenameIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendances",
newName: "IX_Attendances_EmployeeID");
migrationBuilder.AddPrimaryKey(
name: "PK_Attendances",
table: "Attendances",
column: "Id");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "02f1b9b7-9cc5-4822-8090-362ca9b61a8e");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "b9005cdc-0d10-4110-9e42-1d7117b68cd3");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "6df40548-5543-4066-aab4-5f340015b731");
migrationBuilder.AddForeignKey(
name: "FK_AttendanceLogs_Attendances_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId",
principalTable: "Attendances",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
table: "Attendances",
column: "EmployeeID",
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Attendances_Tenants_TenantId",
table: "Attendances",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -1,71 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addIsActiveToProjectAllocation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "ProjectAllocations",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "b04da7e9-0406-409c-ac7f-b97256e6ea02");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "0971c7fb-6ce1-458a-ae3f-8d3205893637");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "504ec132-e6a9-422f-8f85-050602cfce05");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsActive",
table: "ProjectAllocations");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 1,
column: "Key",
value: "6962167a-70de-4e3d-961d-14cfe676ef22");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 2,
column: "Key",
value: "d8d0ed22-ce17-4a73-b507-307c43c08b57");
migrationBuilder.UpdateData(
table: "Modules",
keyColumn: "Id",
keyValue: 3,
column: "Key",
value: "3c0463c6-2842-43ac-b7d3-ca74b26c74a6");
}
}
}

View File

@ -1,40 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addEmergencyContactPersonInEmployeeModel : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "EmergencyContactPerson",
table: "Employees",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AddColumn<bool>(
name: "IsActive",
table: "Employees",
type: "tinyint(1)",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EmergencyContactPerson",
table: "Employees");
migrationBuilder.DropColumn(
name: "IsActive",
table: "Employees");
}
}
}

View File

@ -1,40 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addJobRoleIdInProjectAllocation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EmployeeRoleId",
table: "ProjectAllocations");
migrationBuilder.AddColumn<int>(
name: "JobRoleId",
table: "ProjectAllocations",
type: "int",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "JobRoleId",
table: "ProjectAllocations");
migrationBuilder.AddColumn<Guid>(
name: "EmployeeRoleId",
table: "ProjectAllocations",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
}
}
}

View File

@ -1,29 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Marco.Pms.DataAccess.Migrations
{
/// <inheritdoc />
public partial class addJoiningDateToEmployee : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "JoiningDate",
table: "Employees",
type: "datetime(6)",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "JoiningDate",
table: "Employees");
}
}
}

View File

@ -12,8 +12,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Marco.Pms.DataAccess.Migrations namespace Marco.Pms.DataAccess.Migrations
{ {
[DbContext(typeof(ApplicationDbContext))] [DbContext(typeof(ApplicationDbContext))]
[Migration("20250321010050_addJoiningDateToEmployee")] [Migration("20250326054022_initmigration")]
partial class addJoiningDateToEmployee partial class initmigration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)

View File

@ -9,7 +9,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace Marco.Pms.DataAccess.Migrations namespace Marco.Pms.DataAccess.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class initiateapp : Migration public partial class initmigration : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -77,6 +77,25 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Modules",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Key = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
},
constraints: table =>
{
table.PrimaryKey("PK_Modules", x => x.Id);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Tenants", name: "Tenants",
columns: table => new columns: table => new
@ -256,6 +275,53 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Features",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
ModuleId = table.Column<int>(type: "int", nullable: false),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Features", x => x.Id);
table.ForeignKey(
name: "FK_Features_Modules_ModuleId",
column: x => x.ModuleId,
principalTable: "Modules",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "ApplicationRoles",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Role = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApplicationRoles", x => x.Id);
table.ForeignKey(
name: "FK_ApplicationRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Buildings", name: "Buildings",
columns: table => new columns: table => new
@ -282,42 +348,22 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "EmployeeRoles", name: "JobRoles",
columns: table => new columns: table => new
{ {
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Id = table.Column<int>(type: "int", nullable: false)
Role = table.Column<string>(type: "longtext", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
.Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoles", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoles_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "Feature",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false) Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false) Description = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false) TenantId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_Feature", x => x.Id); table.PrimaryKey("PK_JobRoles", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Feature_Tenants_TenantId", name: "FK_JobRoles_Tenants_TenantId",
column: x => x.TenantId, column: x => x.TenantId,
principalTable: "Tenants", principalTable: "Tenants",
principalColumn: "Id", principalColumn: "Id",
@ -371,6 +417,30 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FeaturePermissions",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeatureId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
Name = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
Description = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FeaturePermissions", x => x.Id);
table.ForeignKey(
name: "FK_FeaturePermissions_Features_FeatureId",
column: x => x.FeatureId,
principalTable: "Features",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Floor", name: "Floor",
columns: table => new columns: table => new
@ -417,6 +487,7 @@ namespace Marco.Pms.DataAccess.Migrations
Gender = table.Column<string>(type: "longtext", nullable: false) Gender = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
BirthDate = table.Column<DateTime>(type: "datetime(6)", nullable: true), BirthDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
JoiningDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
PeramnentAddress = table.Column<string>(type: "longtext", nullable: false) PeramnentAddress = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
CurrentAddress = table.Column<string>(type: "longtext", nullable: false) CurrentAddress = table.Column<string>(type: "longtext", nullable: false)
@ -425,6 +496,8 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
EmergencyPhoneNumber = table.Column<string>(type: "longtext", nullable: false) EmergencyPhoneNumber = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
EmergencyContactPerson = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"),
AadharNumber = table.Column<string>(type: "longtext", nullable: true) AadharNumber = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
PanNumber = table.Column<string>(type: "longtext", nullable: true) PanNumber = table.Column<string>(type: "longtext", nullable: true)
@ -433,7 +506,9 @@ namespace Marco.Pms.DataAccess.Migrations
ApplicationUserId = table.Column<string>(type: "varchar(255)", nullable: true) ApplicationUserId = table.Column<string>(type: "varchar(255)", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
TenantId = table.Column<int>(type: "int", nullable: false), TenantId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci") IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
JobRoleId = table.Column<int>(type: "int", nullable: true)
}, },
constraints: table => constraints: table =>
{ {
@ -444,11 +519,10 @@ namespace Marco.Pms.DataAccess.Migrations
principalTable: "AspNetUsers", principalTable: "AspNetUsers",
principalColumn: "Id"); principalColumn: "Id");
table.ForeignKey( table.ForeignKey(
name: "FK_Employees_EmployeeRoles_RoleId", name: "FK_Employees_JobRoles_JobRoleId",
column: x => x.RoleId, column: x => x.JobRoleId,
principalTable: "EmployeeRoles", principalTable: "JobRoles",
principalColumn: "Id", principalColumn: "Id");
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_Employees_Tenants_TenantId", name: "FK_Employees_Tenants_TenantId",
column: x => x.TenantId, column: x => x.TenantId,
@ -458,40 +532,6 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "FeaturePermission",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeatureId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FeaturePermission", x => x.Id);
table.ForeignKey(
name: "FK_FeaturePermission_EmployeeRoles_RoleId",
column: x => x.RoleId,
principalTable: "EmployeeRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FeaturePermission_Feature_FeatureId",
column: x => x.FeatureId,
principalTable: "Feature",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FeaturePermission_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Projects", name: "Projects",
columns: table => new columns: table => new
@ -527,6 +567,31 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "RolePermissionMappings",
columns: table => new
{
ApplicationRoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
FeaturePermissionId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
},
constraints: table =>
{
table.PrimaryKey("PK_RolePermissionMappings", x => new { x.ApplicationRoleId, x.FeaturePermissionId });
table.ForeignKey(
name: "FK_RolePermissionMappings_ApplicationRoles_ApplicationRoleId",
column: x => x.ApplicationRoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RolePermissionMappings_FeaturePermissions_FeaturePermissionId",
column: x => x.FeaturePermissionId,
principalTable: "FeaturePermissions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "WorkAreas", name: "WorkAreas",
columns: table => new columns: table => new
@ -557,7 +622,7 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "AttendanceLogs", name: "Attendes",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
@ -565,28 +630,61 @@ namespace Marco.Pms.DataAccess.Migrations
Comment = table.Column<string>(type: "longtext", nullable: false) Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
EmployeeID = table.Column<int>(type: "int", nullable: false), EmployeeID = table.Column<int>(type: "int", nullable: false),
CheckTime = table.Column<DateTime>(type: "datetime(6)", nullable: true), Date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
IsCheckIn = table.Column<bool>(type: "tinyint(1)", nullable: false), ProjectID = table.Column<int>(type: "int", nullable: false),
Photo = table.Column<byte[]>(type: "longblob", nullable: true), AttendanceDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Latitude = table.Column<string>(type: "longtext", nullable: true) InTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
.Annotation("MySql:CharSet", "utf8mb4"), OutTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
Longitude = table.Column<string>(type: "longtext", nullable: true) IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false),
.Annotation("MySql:CharSet", "utf8mb4"), Activity = table.Column<int>(type: "int", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false), ApprovedBy = table.Column<int>(type: "int", nullable: true),
UpdatedBy = table.Column<string>(type: "longtext", nullable: true) TenantId = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4")
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_AttendanceLogs", x => x.Id); table.PrimaryKey("PK_Attendes", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_AttendanceLogs_Employees_EmployeeID", name: "FK_Attendes_Employees_EmployeeID",
column: x => x.EmployeeID, column: x => x.EmployeeID,
principalTable: "Employees", principalTable: "Employees",
principalColumn: "Id", principalColumn: "Id",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId", name: "FK_Attendes_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
})
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable(
name: "EmployeeRoleMappings",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
EmployeeId = table.Column<int>(type: "int", nullable: false),
RoleId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
IsEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
TenantId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeRoleMappings", x => x.Id);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_ApplicationRoles_RoleId",
column: x => x.RoleId,
principalTable: "ApplicationRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeRoleMappings_Tenants_TenantId",
column: x => x.TenantId, column: x => x.TenantId,
principalTable: "Tenants", principalTable: "Tenants",
principalColumn: "Id", principalColumn: "Id",
@ -601,7 +699,8 @@ namespace Marco.Pms.DataAccess.Migrations
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
EmployeeId = table.Column<int>(type: "int", nullable: false), EmployeeId = table.Column<int>(type: "int", nullable: false),
EmployeeRoleId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"), JobRoleId = table.Column<int>(type: "int", nullable: true),
IsActive = table.Column<bool>(type: "tinyint(1)", nullable: false),
ProjectId = table.Column<int>(type: "int", nullable: false), ProjectId = table.Column<int>(type: "int", nullable: false),
AllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false), AllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: false),
ReAllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true), ReAllocationDate = table.Column<DateTime>(type: "datetime(6)", nullable: true),
@ -683,43 +782,48 @@ namespace Marco.Pms.DataAccess.Migrations
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Attendances", name: "AttendanceLogs",
columns: table => new columns: table => new
{ {
Id = table.Column<int>(type: "int", nullable: false) Id = table.Column<int>(type: "int", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Comment = table.Column<string>(type: "longtext", nullable: false) Comment = table.Column<string>(type: "longtext", nullable: false)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
AttendanceId = table.Column<int>(type: "int", nullable: false),
EmployeeID = table.Column<int>(type: "int", nullable: false), EmployeeID = table.Column<int>(type: "int", nullable: false),
Date = table.Column<DateTime>(type: "datetime(6)", nullable: false), ActivityTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
InTimeID = table.Column<int>(type: "int", nullable: true), Activity = table.Column<int>(type: "int", nullable: false),
OutTimeID = table.Column<int>(type: "int", nullable: true), Photo = table.Column<byte[]>(type: "longblob", nullable: true),
IsApproved = table.Column<bool>(type: "tinyint(1)", nullable: false), Latitude = table.Column<string>(type: "longtext", nullable: true)
ApprovedBy = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"), .Annotation("MySql:CharSet", "utf8mb4"),
Longitude = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
UpdatedOn = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedBy = table.Column<int>(type: "int", nullable: true),
TenantId = table.Column<int>(type: "int", nullable: false) TenantId = table.Column<int>(type: "int", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_Attendances", x => x.Id); table.PrimaryKey("PK_AttendanceLogs", x => x.Id);
table.ForeignKey( table.ForeignKey(
name: "FK_Attendances_AttendanceLogs_InTimeID", name: "FK_AttendanceLogs_Attendes_AttendanceId",
column: x => x.InTimeID, column: x => x.AttendanceId,
principalTable: "AttendanceLogs", principalTable: "Attendes",
principalColumn: "Id"); principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_Attendances_AttendanceLogs_OutTimeID", name: "FK_AttendanceLogs_Employees_EmployeeID",
column: x => x.OutTimeID,
principalTable: "AttendanceLogs",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Attendances_Employees_EmployeeID",
column: x => x.EmployeeID, column: x => x.EmployeeID,
principalTable: "Employees", principalTable: "Employees",
principalColumn: "Id", principalColumn: "Id",
onDelete: ReferentialAction.Cascade); onDelete: ReferentialAction.Cascade);
table.ForeignKey( table.ForeignKey(
name: "FK_Attendances_Tenants_TenantId", name: "FK_AttendanceLogs_Employees_UpdatedBy",
column: x => x.UpdatedBy,
principalTable: "Employees",
principalColumn: "Id");
table.ForeignKey(
name: "FK_AttendanceLogs_Tenants_TenantId",
column: x => x.TenantId, column: x => x.TenantId,
principalTable: "Tenants", principalTable: "Tenants",
principalColumn: "Id", principalColumn: "Id",
@ -828,6 +932,16 @@ namespace Marco.Pms.DataAccess.Migrations
}) })
.Annotation("MySql:CharSet", "utf8mb4"); .Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "Modules",
columns: new[] { "Id", "Description", "Key", "Name" },
values: new object[,]
{
{ 1, "Project Module", "b04da7e9-0406-409c-ac7f-b97256e6ea02", "Project" },
{ 2, "Employee Module", "0971c7fb-6ce1-458a-ae3f-8d3205893637", "Employee" },
{ 3, "Masters Module", "504ec132-e6a9-422f-8f85-050602cfce05", "Masters" }
});
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "Tenants", table: "Tenants",
columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "Name", "OnBoardingDate" }, columns: new[] { "Id", "ContactName", "ContactNumber", "Description", "DomainName", "Name", "OnBoardingDate" },
@ -855,15 +969,30 @@ namespace Marco.Pms.DataAccess.Migrations
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "EmployeeRoles", table: "ApplicationRoles",
columns: new[] { "Id", "Role", "TenantId" }, columns: new[] { "Id", "Description", "Role", "TenantId" },
values: new object[,] values: new object[,]
{ {
{ new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "Admin", 1 }, { new Guid("2c8d0808-c421-11ef-9b93-0242ac110002"), "", "Admin", 1 },
{ new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "Welder", 1 }, { new Guid("62e0918d-c421-11ef-9b93-0242ac110002"), "", "Welder", 1 },
{ new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "Helper", 1 }, { new Guid("68823f1f-c421-11ef-9b93-0242ac110002"), "", "Helper", 1 },
{ new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "Site Engineer", 1 }, { new Guid("6d3a7c72-c421-11ef-9b93-0242ac110002"), "", "Site Engineer", 1 },
{ new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "Project Manager", 1 } { new Guid("6d3aad72-c421-11ef-9b93-0242ac110002"), "", "Project Manager", 1 }
});
migrationBuilder.InsertData(
table: "Features",
columns: new[] { "Id", "Description", "IsActive", "ModuleId", "Name" },
values: new object[,]
{
{ new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), "Assign and Update Tasks Progress", true, 1, "Assign and Update Tasks Progress" },
{ new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), "Attendance", true, 2, "Attendance" },
{ new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), "Manage Project", true, 1, "Manage Project" },
{ new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), "Tenant Masters", true, 3, "Tenant Masters" },
{ new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), "Manage Employee", true, 2, "Manage Employee" },
{ new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), "Manage Infra", true, 1, "Manage Infra" },
{ new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), "Manage Tasks", true, 1, "Manage Tasks" },
{ new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), "Global Masters", true, 3, "Global Masters" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -877,6 +1006,31 @@ namespace Marco.Pms.DataAccess.Migrations
{ 4, "Completed", 1 } { 4, "Completed", 1 }
}); });
migrationBuilder.InsertData(
table: "FeaturePermissions",
columns: new[] { "Id", "Description", "FeatureId", "IsEnabled", "Name" },
values: new object[,]
{
{ new Guid("08752f33-3b29-4816-b76b-ea8a968ed3c5"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "Manage Task" },
{ new Guid("172fc9b6-755b-4f62-ab26-55c34a330614"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Project" },
{ new Guid("57802c4a-00aa-4a1f-a048-fd2f70dd44b6"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Regularize Attendance" },
{ new Guid("588a8824-f924-4955-82d8-fc51956cf323"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "Manage Masters" },
{ new Guid("5ffbafe0-7ab0-48b1-bb50-c1bf76b65f9d"), "", new Guid("be3b3afc-6ccf-4566-b9b6-aafcb65546be"), true, "View Masters" },
{ new Guid("6b1a6d97-a951-4de5-9b19-709bac7c4f18"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "Manage Masters" },
{ new Guid("6ea44136-987e-44ba-9e5d-1cf8f5837ebc"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "View Project" },
{ new Guid("915e6bff-65f6-4e3f-aea8-3fd217d3ea9e"), "", new Guid("52c9cf54-1eb2-44d2-81bb-524cf29c0a94"), true, "Perform Attendance " },
{ new Guid("9fcc5f87-25e3-4846-90ac-67a71ab92e3c"), "", new Guid("9d4b5489-2079-40b9-bd77-6e1bf90bc19f"), true, "View Task" },
{ new Guid("a97d366a-c2bb-448d-be93-402bd2324566"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Manage Employee" },
{ new Guid("b82d2b7e-0d52-45f3-997b-c008ea460e7f"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "View Employee" },
{ new Guid("b94802ce-0689-4643-9e1d-11c86950c35b"), "", new Guid("53176ebf-c75d-42e5-839f-4508ffac3def"), true, "Manage Team" },
{ new Guid("c7b68e33-72f0-474f-bd96-77636427ecc8"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "View Project Infra" },
{ new Guid("cb8ec407-46d4-4467-930c-69127cda6dec"), "", new Guid("660131a4-788c-4739-a082-cbbf7879cbf2"), true, "View Masters" },
{ new Guid("d135a4b0-4f9a-4903-ab9c-4843839ebdee"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Assign Task and Report Progress" },
{ new Guid("ed99ecd4-1bed-42e1-b7b3-d64c04493823"), "", new Guid("39e66f81-efc6-446c-95bd-46bff6cfb606"), true, "Approve Task" },
{ new Guid("f2aee20a-b754-4537-8166-f9507b44585b"), "", new Guid("9666de86-d7c7-4d3d-acaa-fcd6d6b81f3c"), true, "Manage Project Infra" },
{ new Guid("fbd213e0-0250-46f1-9f5f-4b2a1e6e76a3"), "", new Guid("81ab8a87-8ccd-4015-a917-0627cee6a100"), true, "Assign To Project" }
});
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "Projects", table: "Projects",
columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" }, columns: new[] { "Id", "ContactPerson", "EndDate", "Name", "ProjectAddress", "ProjectStatusId", "StartDate", "TenantId" },
@ -897,6 +1051,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "ActivityMasters", table: "ActivityMasters",
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_ApplicationRoles_TenantId",
table: "ApplicationRoles",
column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId", name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims", table: "AspNetRoleClaims",
@ -934,6 +1093,11 @@ namespace Marco.Pms.DataAccess.Migrations
column: "NormalizedUserName", column: "NormalizedUserName",
unique: true); unique: true);
migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_AttendanceId",
table: "AttendanceLogs",
column: "AttendanceId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_AttendanceLogs_EmployeeID", name: "IX_AttendanceLogs_EmployeeID",
table: "AttendanceLogs", table: "AttendanceLogs",
@ -945,23 +1109,18 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Attendances_EmployeeID", name: "IX_AttendanceLogs_UpdatedBy",
table: "Attendances", table: "AttendanceLogs",
column: "UpdatedBy");
migrationBuilder.CreateIndex(
name: "IX_Attendes_EmployeeID",
table: "Attendes",
column: "EmployeeID"); column: "EmployeeID");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Attendances_InTimeID", name: "IX_Attendes_TenantId",
table: "Attendances", table: "Attendes",
column: "InTimeID");
migrationBuilder.CreateIndex(
name: "IX_Attendances_OutTimeID",
table: "Attendances",
column: "OutTimeID");
migrationBuilder.CreateIndex(
name: "IX_Attendances_TenantId",
table: "Attendances",
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
@ -970,8 +1129,18 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_EmployeeRoles_TenantId", name: "IX_EmployeeRoleMappings_EmployeeId",
table: "EmployeeRoles", table: "EmployeeRoleMappings",
column: "EmployeeId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_RoleId",
table: "EmployeeRoleMappings",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeRoleMappings_TenantId",
table: "EmployeeRoleMappings",
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
@ -980,9 +1149,9 @@ namespace Marco.Pms.DataAccess.Migrations
column: "ApplicationUserId"); column: "ApplicationUserId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Employees_RoleId", name: "IX_Employees_JobRoleId",
table: "Employees", table: "Employees",
column: "RoleId"); column: "JobRoleId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Employees_TenantId", name: "IX_Employees_TenantId",
@ -990,24 +1159,14 @@ namespace Marco.Pms.DataAccess.Migrations
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Feature_TenantId", name: "IX_FeaturePermissions_FeatureId",
table: "Feature", table: "FeaturePermissions",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_FeatureId",
table: "FeaturePermission",
column: "FeatureId"); column: "FeatureId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_RoleId", name: "IX_Features_ModuleId",
table: "FeaturePermission", table: "Features",
column: "RoleId"); column: "ModuleId");
migrationBuilder.CreateIndex(
name: "IX_FeaturePermission_TenantId",
table: "FeaturePermission",
column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_Floor_BuildingId", name: "IX_Floor_BuildingId",
@ -1019,6 +1178,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "Floor", table: "Floor",
column: "TenantId"); column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_JobRoles_TenantId",
table: "JobRoles",
column: "TenantId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_ProjectAllocations_EmployeeId", name: "IX_ProjectAllocations_EmployeeId",
table: "ProjectAllocations", table: "ProjectAllocations",
@ -1049,6 +1213,11 @@ namespace Marco.Pms.DataAccess.Migrations
table: "RefreshTokens", table: "RefreshTokens",
column: "UserId"); column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_RolePermissionMappings_FeaturePermissionId",
table: "RolePermissionMappings",
column: "FeaturePermissionId");
migrationBuilder.CreateIndex( migrationBuilder.CreateIndex(
name: "IX_StatusMasters_TenantId", name: "IX_StatusMasters_TenantId",
table: "StatusMasters", table: "StatusMasters",
@ -1144,10 +1313,10 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetUserTokens"); name: "AspNetUserTokens");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Attendances"); name: "AttendanceLogs");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "FeaturePermission"); name: "EmployeeRoleMappings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ProjectAllocations"); name: "ProjectAllocations");
@ -1155,6 +1324,9 @@ namespace Marco.Pms.DataAccess.Migrations
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "RefreshTokens"); name: "RefreshTokens");
migrationBuilder.DropTable(
name: "RolePermissionMappings");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "WorkItemMapping"); name: "WorkItemMapping");
@ -1165,17 +1337,26 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetRoles"); name: "AspNetRoles");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "AttendanceLogs"); name: "Attendes");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Feature"); name: "ApplicationRoles");
migrationBuilder.DropTable(
name: "FeaturePermissions");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "WorkItems"); name: "WorkItems");
migrationBuilder.DropTable(
name: "Features");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ActivityMasters"); name: "ActivityMasters");
migrationBuilder.DropTable(
name: "Modules");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "TaskAllocations"); name: "TaskAllocations");
@ -1192,7 +1373,7 @@ namespace Marco.Pms.DataAccess.Migrations
name: "AspNetUsers"); name: "AspNetUsers");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "EmployeeRoles"); name: "JobRoles");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "StatusMasters"); name: "StatusMasters");