using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace StubbedContextLib.Migrations { /// public partial class myFirstMigration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Character", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Character", x => x.Id); }); migrationBuilder.CreateTable( name: "Images", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ImgPath = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Images", x => x.Id); }); migrationBuilder.CreateTable( name: "Question", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Text = table.Column(type: "nvarchar(max)", nullable: false), AnswerA = table.Column(type: "nvarchar(max)", nullable: false), AnswerB = table.Column(type: "nvarchar(max)", nullable: false), AnswerC = table.Column(type: "nvarchar(max)", nullable: false), AnswerD = table.Column(type: "nvarchar(max)", nullable: false), CorrectAnswer = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Question", x => x.Id); }); migrationBuilder.CreateTable( name: "Quiz", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Title = table.Column(type: "nvarchar(max)", nullable: false), NbQuestion = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Quiz", x => x.Id); }); migrationBuilder.CreateTable( name: "Quote", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Content = table.Column(type: "nvarchar(max)", nullable: false), Likes = table.Column(type: "int", nullable: false), Langage = table.Column(type: "int", nullable: false), IsValid = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Quote", x => x.Id); }); migrationBuilder.CreateTable( name: "Source", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Title = table.Column(type: "nvarchar(max)", nullable: false), Year = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Source", x => x.Id); }); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserName = table.Column(type: "nvarchar(max)", nullable: false), Email = table.Column(type: "nvarchar(max)", nullable: false), Password = table.Column(type: "nvarchar(max)", nullable: false), Created = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); migrationBuilder.InsertData( table: "Users", columns: new[] { "Id", "Created", "Email", "Password", "UserName" }, values: new object[] { 1, new DateTime(2000, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "dev@gmail.com", "1234", "Dev" }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Character"); migrationBuilder.DropTable( name: "Images"); migrationBuilder.DropTable( name: "Question"); migrationBuilder.DropTable( name: "Quiz"); migrationBuilder.DropTable( name: "Quote"); migrationBuilder.DropTable( name: "Source"); migrationBuilder.DropTable( name: "Users"); } } }