asg_backend/asg_form/Migrations/20241102154730_sh1.cs
2024-11-03 00:08:34 +08:00

163 lines
5.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace asg_form.Migrations
{
/// <inheritdoc />
public partial class sh1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers");
migrationBuilder.AlterColumn<string>(
name: "opentime",
table: "F_game",
type: "text",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<string>(
name: "final_score",
table: "F_game",
type: "text",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "judge_Id",
table: "F_game",
type: "integer",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "referee_Id",
table: "F_game",
type: "integer",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "point",
table: "AspNetUsers",
type: "integer",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<long>(
name: "myteamId",
table: "AspNetUsers",
type: "bigint",
nullable: true,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AddColumn<string>(
name: "roleListCode",
table: "AspNetUsers",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "roleListName",
table: "AspNetUsers",
type: "text",
nullable: true);
migrationBuilder.AlterColumn<string>(
name: "msg",
table: "AspNetRoles",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers",
column: "myteamId",
principalTable: "F_Team",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "final_score",
table: "F_game");
migrationBuilder.DropColumn(
name: "judge_Id",
table: "F_game");
migrationBuilder.DropColumn(
name: "referee_Id",
table: "F_game");
migrationBuilder.DropColumn(
name: "roleListCode",
table: "AspNetUsers");
migrationBuilder.DropColumn(
name: "roleListName",
table: "AspNetUsers");
migrationBuilder.AlterColumn<DateTime>(
name: "opentime",
table: "F_game",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<int>(
name: "point",
table: "AspNetUsers",
type: "integer",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "integer",
oldNullable: true);
migrationBuilder.AlterColumn<long>(
name: "myteamId",
table: "AspNetUsers",
type: "bigint",
nullable: false,
defaultValue: 0L,
oldClrType: typeof(long),
oldType: "bigint",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "msg",
table: "AspNetRoles",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_AspNetUsers_F_Team_myteamId",
table: "AspNetUsers",
column: "myteamId",
principalTable: "F_Team",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}