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