using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace MTWorkHR.Infrastructure.Migrations { /// public partial class altrcity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "NameFr", table: "CountryLookups", type: "nvarchar(max)", nullable: false, defaultValue: ""); migrationBuilder.CreateTable( name: "Cities", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), NameAr = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), NameEn = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: false), NameFr = table.Column(type: "nvarchar(max)", nullable: false), CountryId = table.Column(type: "bigint", nullable: false), Code = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Cities", x => x.Id); table.ForeignKey( name: "FK_Cities_CountryLookups_CountryId", column: x => x.CountryId, principalTable: "CountryLookups", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "LoginOTPs", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), OTP = table.Column(type: "nvarchar(max)", nullable: false), UserId = table.Column(type: "nvarchar(max)", nullable: false), CreateDate = table.Column(type: "datetime2", nullable: false), ExpireDate = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_LoginOTPs", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_Cities_CountryId", table: "Cities", column: "CountryId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Cities"); migrationBuilder.DropTable( name: "LoginOTPs"); migrationBuilder.DropColumn( name: "NameFr", table: "CountryLookups"); } } }