using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Migrations { /// public partial class AddRatings : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Ratings", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), GameId = table.Column(type: "TEXT", nullable: true), Source = table.Column(type: "TEXT", maxLength: 128, nullable: true), Value = table.Column(type: "REAL", nullable: false), CreatedOn = table.Column(type: "TEXT", nullable: false), CreatedById = table.Column(type: "TEXT", nullable: true), UpdatedOn = table.Column(type: "TEXT", nullable: false), UpdatedById = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Ratings", x => x.Id); table.ForeignKey( name: "FK_Ratings_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Ratings_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Ratings_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }); migrationBuilder.CreateIndex( name: "IX_Ratings_CreatedById", table: "Ratings", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Ratings_GameId", table: "Ratings", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Ratings_UpdatedById", table: "Ratings", column: "UpdatedById"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Ratings"); } } }