using System; using Microsoft.EntityFrameworkCore.Migrations; namespace IOL.Fagprove.Migrations { public partial class Intial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Cabins", columns: table => new { Id = table.Column(nullable: false), CreatedUtc = table.Column(nullable: true), CreatedBy = table.Column(nullable: true), ModifiedUtc = table.Column(nullable: true), ModifiedBy = table.Column(nullable: true), CategoryId = table.Column(nullable: false), Name = table.Column(nullable: true), Capacity = table.Column(nullable: true), Price = table.Column(nullable: true), Description = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Cabins", x => x.Id); }); migrationBuilder.CreateTable( name: "Reservations", columns: table => new { Id = table.Column(nullable: false), CreatedUtc = table.Column(nullable: true), CreatedBy = table.Column(nullable: true), ModifiedUtc = table.Column(nullable: true), ModifiedBy = table.Column(nullable: true), UserId = table.Column(nullable: false), ReservationObjectId = table.Column(nullable: false), From = table.Column(nullable: false), To = table.Column(nullable: false), Status = table.Column(nullable: false), Extra = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Reservations", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(nullable: false), CreatedUtc = table.Column(nullable: true), CreatedBy = table.Column(nullable: true), ModifiedUtc = table.Column(nullable: true), ModifiedBy = table.Column(nullable: true), Name = table.Column(nullable: true), Email = table.Column(nullable: true), Password = table.Column(nullable: true), Role = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.InsertData( table: "Users", columns: new[] { "Id", "CreatedBy", "CreatedUtc", "Email", "ModifiedBy", "ModifiedUtc", "Name", "Password", "Role" }, values: new object[] { new Guid("d2512ef5-f25e-486d-a94d-1ea43c732195"), null, new DateTime(2020, 2, 5, 23, 30, 13, 316, DateTimeKind.Utc).AddTicks(6060), "ivar@protektit.no", null, null, "Ivar Løvlie Administrator", "9F267A5EC952ABC97CC5B768AEF42337", 1 }); migrationBuilder.InsertData( table: "Users", columns: new[] { "Id", "CreatedBy", "CreatedUtc", "Email", "ModifiedBy", "ModifiedUtc", "Name", "Password", "Role" }, values: new object[] { new Guid("e166655c-cbdc-4128-8e0e-9aeb9c52093d"), null, new DateTime(2020, 2, 5, 23, 30, 13, 320, DateTimeKind.Utc).AddTicks(310), "ivarino@protektit.no", null, null, "Ivar Løvlie Standard", "9F267A5EC952ABC97CC5B768AEF42337", 0 }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Cabins"); migrationBuilder.DropTable( name: "Reservations"); migrationBuilder.DropTable( name: "Users"); } } }