using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RazorPagesMovie.Migrations { /// public partial class AddAdminUserAndContactMessage : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AdminUser", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Username = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), PasswordHash = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AdminUser", x => x.Id); }); migrationBuilder.CreateTable( name: "ContactMessage", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Email = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), Phone = table.Column(type: "nvarchar(30)", maxLength: 30, nullable: true), Subject = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: true), Message = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), SentAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ContactMessage", x => x.Id); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AdminUser"); migrationBuilder.DropTable( name: "ContactMessage"); } } }