using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Marco.Pms.DataAccess.Migrations { /// public partial class Added_Check_List_Table : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "PeramnentAddress", table: "Employees"); migrationBuilder.AlterColumn( name: "Name", table: "WorkShifts", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "Tenants", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "DomainName", table: "Tenants", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Description", table: "Tenants", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "ContactNumber", table: "Tenants", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "ContactName", table: "Tenants", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Status", table: "StatusMasters", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "UserId", table: "RefreshTokens", type: "varchar(255)", nullable: true, oldClrType: typeof(string), oldType: "varchar(255)") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Token", table: "RefreshTokens", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "ProjectAddress", table: "Projects", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "ContactPerson", table: "Projects", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Description", table: "Modules", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "JobRoles", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "Industries", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "Features", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Description", table: "Features", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Name", table: "FeaturePermissions", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Description", table: "FeaturePermissions", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "PhoneNumber", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "LastName", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Gender", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "FirstName", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "EmergencyPhoneNumber", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "EmergencyContactPerson", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "CurrentAddress", table: "Employees", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "PermanentAddress", table: "Employees", type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Role", table: "ApplicationRoles", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "Description", table: "ApplicationRoles", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "UnitOfMeasurement", table: "ActivityMasters", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AlterColumn( name: "ActivityName", table: "ActivityMasters", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "longtext") .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "IsActive", table: "ActivityMasters", type: "tinyint(1)", nullable: false, defaultValue: false); migrationBuilder.CreateTable( name: "ActivityCheckLists", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ActivityMasterId = table.Column(type: "int", nullable: false), Check = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsChecked = table.Column(type: "tinyint(1)", nullable: false), IsMandatory = table.Column(type: "tinyint(1)", nullable: false), TenantId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ActivityCheckLists", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 1, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 2, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 3, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 4, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 5, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 6, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 7, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 8, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 9, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 10, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 11, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 12, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 13, column: "IsActive", value: true); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "Id", keyValue: 14, column: "IsActive", value: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ActivityCheckLists"); migrationBuilder.DropColumn( name: "PermanentAddress", table: "Employees"); migrationBuilder.DropColumn( name: "IsActive", table: "ActivityMasters"); migrationBuilder.UpdateData( table: "WorkShifts", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "WorkShifts", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Tenants", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "Tenants", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Tenants", keyColumn: "DomainName", keyValue: null, column: "DomainName", value: ""); migrationBuilder.AlterColumn( name: "DomainName", table: "Tenants", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Tenants", keyColumn: "Description", keyValue: null, column: "Description", value: ""); migrationBuilder.AlterColumn( name: "Description", table: "Tenants", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Tenants", keyColumn: "ContactNumber", keyValue: null, column: "ContactNumber", value: ""); migrationBuilder.AlterColumn( name: "ContactNumber", table: "Tenants", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Tenants", keyColumn: "ContactName", keyValue: null, column: "ContactName", value: ""); migrationBuilder.AlterColumn( name: "ContactName", table: "Tenants", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "StatusMasters", keyColumn: "Status", keyValue: null, column: "Status", value: ""); migrationBuilder.AlterColumn( name: "Status", table: "StatusMasters", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "RefreshTokens", keyColumn: "UserId", keyValue: null, column: "UserId", value: ""); migrationBuilder.AlterColumn( name: "UserId", table: "RefreshTokens", type: "varchar(255)", nullable: false, oldClrType: typeof(string), oldType: "varchar(255)", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "RefreshTokens", keyColumn: "Token", keyValue: null, column: "Token", value: ""); migrationBuilder.AlterColumn( name: "Token", table: "RefreshTokens", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Projects", keyColumn: "ProjectAddress", keyValue: null, column: "ProjectAddress", value: ""); migrationBuilder.AlterColumn( name: "ProjectAddress", table: "Projects", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Projects", keyColumn: "ContactPerson", keyValue: null, column: "ContactPerson", value: ""); migrationBuilder.AlterColumn( name: "ContactPerson", table: "Projects", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Modules", keyColumn: "Description", keyValue: null, column: "Description", value: ""); migrationBuilder.AlterColumn( name: "Description", table: "Modules", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "JobRoles", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "JobRoles", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Industries", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "Industries", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Features", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "Features", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Features", keyColumn: "Description", keyValue: null, column: "Description", value: ""); migrationBuilder.AlterColumn( name: "Description", table: "Features", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "FeaturePermissions", keyColumn: "Name", keyValue: null, column: "Name", value: ""); migrationBuilder.AlterColumn( name: "Name", table: "FeaturePermissions", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "FeaturePermissions", keyColumn: "Description", keyValue: null, column: "Description", value: ""); migrationBuilder.AlterColumn( name: "Description", table: "FeaturePermissions", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "PhoneNumber", keyValue: null, column: "PhoneNumber", value: ""); migrationBuilder.AlterColumn( name: "PhoneNumber", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "LastName", keyValue: null, column: "LastName", value: ""); migrationBuilder.AlterColumn( name: "LastName", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "Gender", keyValue: null, column: "Gender", value: ""); migrationBuilder.AlterColumn( name: "Gender", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "FirstName", keyValue: null, column: "FirstName", value: ""); migrationBuilder.AlterColumn( name: "FirstName", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "EmergencyPhoneNumber", keyValue: null, column: "EmergencyPhoneNumber", value: ""); migrationBuilder.AlterColumn( name: "EmergencyPhoneNumber", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "EmergencyContactPerson", keyValue: null, column: "EmergencyContactPerson", value: ""); migrationBuilder.AlterColumn( name: "EmergencyContactPerson", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "Employees", keyColumn: "CurrentAddress", keyValue: null, column: "CurrentAddress", value: ""); migrationBuilder.AlterColumn( name: "CurrentAddress", table: "Employees", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.AddColumn( name: "PeramnentAddress", table: "Employees", type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "ApplicationRoles", keyColumn: "Role", keyValue: null, column: "Role", value: ""); migrationBuilder.AlterColumn( name: "Role", table: "ApplicationRoles", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "ApplicationRoles", keyColumn: "Description", keyValue: null, column: "Description", value: ""); migrationBuilder.AlterColumn( name: "Description", table: "ApplicationRoles", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "UnitOfMeasurement", keyValue: null, column: "UnitOfMeasurement", value: ""); migrationBuilder.AlterColumn( name: "UnitOfMeasurement", table: "ActivityMasters", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.UpdateData( table: "ActivityMasters", keyColumn: "ActivityName", keyValue: null, column: "ActivityName", value: ""); migrationBuilder.AlterColumn( name: "ActivityName", table: "ActivityMasters", type: "longtext", nullable: false, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); } } }