using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.Migrations { /// public partial class StudentAddEmailPhone : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "EventId", table: "Teams", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "Name", table: "Teams", type: "TEXT", nullable: false, defaultValue: ""); migrationBuilder.AlterColumn( name: "OfficerRole", table: "Students", type: "INTEGER", nullable: true, oldClrType: typeof(string), oldType: "TEXT", oldNullable: true); migrationBuilder.AddColumn( name: "Email", table: "Students", type: "TEXT", nullable: true); migrationBuilder.AddColumn( name: "PhoneNumber", table: "Students", type: "TEXT", nullable: true); migrationBuilder.CreateIndex( name: "IX_Teams_EventId", table: "Teams", column: "EventId"); migrationBuilder.AddForeignKey( name: "FK_Teams_Events_EventId", table: "Teams", column: "EventId", principalTable: "Events", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Teams_Events_EventId", table: "Teams"); migrationBuilder.DropIndex( name: "IX_Teams_EventId", table: "Teams"); migrationBuilder.DropColumn( name: "EventId", table: "Teams"); migrationBuilder.DropColumn( name: "Name", table: "Teams"); migrationBuilder.DropColumn( name: "Email", table: "Students"); migrationBuilder.DropColumn( name: "PhoneNumber", table: "Students"); migrationBuilder.AlterColumn( name: "OfficerRole", table: "Students", type: "TEXT", nullable: true, oldClrType: typeof(int), oldType: "INTEGER", oldNullable: true); } } }