using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace KoogleApp.Migrations { /// public partial class _002 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Days", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PostDate = table.Column(type: "datetime2", nullable: false), Status = table.Column(type: "int", nullable: false), Players = table.Column(type: "nvarchar(max)", nullable: true), CreatedAt = table.Column(type: "datetime2", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: true), ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Days", x => x.Id); }); migrationBuilder.CreateTable( name: "Players", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: true), ModifiedBy = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false) }, constraints: table => { table.PrimaryKey("PK_Players", x => x.Id); }); migrationBuilder.CreateTable( name: "PlayerExpenses", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PlayerId = table.Column(type: "int", nullable: false), Name = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlayerExpenses", x => x.Id); table.ForeignKey( name: "FK_PlayerExpenses_Players_PlayerId", column: x => x.PlayerId, principalTable: "Players", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Days_PostDate", table: "Days", column: "PostDate"); migrationBuilder.CreateIndex( name: "IX_PlayerExpenses_PlayerId", table: "PlayerExpenses", column: "PlayerId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Days"); migrationBuilder.DropTable( name: "PlayerExpenses"); migrationBuilder.DropTable( name: "Players"); } } }