asg_backend/asg_form/Migrations/20250215163639_guid.cs
2025-02-16 00:44:37 +08:00

637 lines
31 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace asg_form.Migrations
{
/// <inheritdoc />
public partial class guid : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
msg = table.Column<string>(type: "text", nullable: true),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "F_blog",
columns: table => new
{
ID = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
title = table.Column<string>(type: "text", nullable: false),
msg = table.Column<string>(type: "text", nullable: false),
formuser = table.Column<string>(type: "text", nullable: false),
pushtime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_blog", x => x.ID);
});
migrationBuilder.CreateTable(
name: "F_ComForm",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<int>(type: "integer", nullable: false),
comSex = table.Column<string>(type: "text", nullable: false),
Com_Cocial_media = table.Column<string>(type: "text", nullable: false),
idv_id = table.Column<string>(type: "text", nullable: false),
introduction = table.Column<string>(type: "text", nullable: false),
Com_qq = table.Column<string>(type: "text", nullable: false),
Status = table.Column<string>(type: "text", nullable: false),
createTime = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_ComForm", x => x.Id);
});
migrationBuilder.CreateTable(
name: "F_events",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
name = table.Column<string>(type: "text", nullable: true),
is_over = table.Column<bool>(type: "boolean", nullable: true),
opentime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
events_rule_uri = table.Column<string>(type: "text", nullable: true),
promChart = table.Column<string>(type: "text", nullable: true),
status = table.Column<string>(type: "text", nullable: false),
config = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_F_events", x => x.Id);
});
migrationBuilder.CreateTable(
name: "F_Friend",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
headName = table.Column<string>(type: "text", nullable: false),
comMsg = table.Column<string>(type: "text", nullable: false),
headTel = table.Column<string>(type: "text", nullable: false),
account = table.Column<string>(type: "text", nullable: false),
comTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
comType = table.Column<string>(type: "text", nullable: false),
orgName = table.Column<string>(type: "text", nullable: false),
degree = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_Friend", x => x.id);
});
migrationBuilder.CreateTable(
name: "F_game",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
team1_name = table.Column<string>(type: "text", nullable: false),
team1_piaoshu = table.Column<int>(type: "integer", nullable: false),
team2_name = table.Column<string>(type: "text", nullable: false),
team2_piaoshu = table.Column<int>(type: "integer", nullable: false),
opentime = table.Column<string>(type: "text", nullable: false),
commentary = table.Column<string>(type: "text", nullable: false),
referee = table.Column<string>(type: "text", nullable: true),
referee_Id = table.Column<int>(type: "integer", nullable: true),
bilibiliuri = table.Column<string>(type: "text", nullable: true),
winteam = table.Column<string>(type: "text", nullable: true),
tag = table.Column<string>(type: "text", nullable: true),
belong = table.Column<string>(type: "text", nullable: true),
judge = table.Column<string>(type: "text", nullable: true),
judge_Id = table.Column<int>(type: "integer", nullable: true),
com_limit = table.Column<int>(type: "integer", nullable: false),
person_type = table.Column<string>(type: "text", nullable: true),
final_score = table.Column<string>(type: "text", nullable: true),
Remarks = table.Column<string>(type: "text", nullable: true),
isAllowChoose = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_game", x => x.id);
});
migrationBuilder.CreateTable(
name: "F_news",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Title = table.Column<string>(type: "text", nullable: false),
FormName = table.Column<string>(type: "text", nullable: false),
time = table.Column<string>(type: "text", nullable: false),
msg = table.Column<string>(type: "text", nullable: false),
Type = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_news", x => x.Id);
});
migrationBuilder.CreateTable(
name: "F_qquser",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
qqid = table.Column<string>(type: "text", nullable: false),
money = table.Column<int>(type: "integer", nullable: false),
time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_qquser", x => x.Id);
});
migrationBuilder.CreateTable(
name: "T_Config",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Title = table.Column<string>(type: "text", nullable: false),
Substance = table.Column<string>(type: "text", nullable: false),
msg = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Config", x => x.Id);
});
migrationBuilder.CreateTable(
name: "T_Store",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Price = table.Column<long>(type: "bigint", nullable: false),
description = table.Column<string>(type: "text", nullable: false),
information = table.Column<string>(type: "text", nullable: false),
Type = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Store", x => x.id);
});
migrationBuilder.CreateTable(
name: "T_Task",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
chinaname = table.Column<string>(type: "text", nullable: false),
createPerson = table.Column<string>(type: "text", nullable: false),
createUserId = table.Column<long>(type: "bigint", nullable: true),
userId = table.Column<long>(type: "bigint", nullable: false),
taskName = table.Column<string>(type: "text", nullable: false),
taskDescription = table.Column<string>(type: "text", nullable: false),
status = table.Column<string>(type: "text", nullable: false),
money = table.Column<long>(type: "bigint", nullable: false),
createTime = table.Column<string>(type: "text", nullable: false),
lastOperateTime = table.Column<string>(type: "text", nullable: false),
approvalPerson = table.Column<string>(type: "text", nullable: false),
priority = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Task", x => x.id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<long>(type: "bigint", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "F_form",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
piaoshu = table.Column<int>(type: "integer", nullable: false),
time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
team_name = table.Column<string>(type: "text", nullable: false),
team_password = table.Column<string>(type: "text", nullable: false),
team_tel = table.Column<string>(type: "text", nullable: false),
logo_uri = table.Column<string>(type: "text", nullable: false),
eventsId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_form", x => x.Id);
table.ForeignKey(
name: "FK_F_form_F_events_eventsId",
column: x => x.eventsId,
principalTable: "F_events",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "F_achlog",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
userid = table.Column<string>(type: "text", nullable: false),
teamid = table.Column<long>(type: "bigint", nullable: false),
chickteam = table.Column<string>(type: "text", nullable: false),
win = table.Column<bool>(type: "boolean", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_F_achlog", x => x.Id);
table.ForeignKey(
name: "FK_F_achlog_F_game_teamid",
column: x => x.teamid,
principalTable: "F_game",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "T_Storeinfo",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
buyerid = table.Column<long>(type: "bigint", nullable: false),
Storeid = table.Column<Guid>(type: "uuid", nullable: false),
isVerification = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_T_Storeinfo", x => x.id);
table.ForeignKey(
name: "FK_T_Storeinfo_T_Store_Storeid",
column: x => x.Storeid,
principalTable: "T_Store",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserBase64 = table.Column<string>(type: "text", nullable: true),
Integral = table.Column<long>(type: "bigint", nullable: true),
haveformId = table.Column<long>(type: "bigint", nullable: true),
isbooking = table.Column<bool>(type: "boolean", nullable: true),
chinaname = table.Column<string>(type: "text", nullable: true),
officium = table.Column<string>(type: "text", nullable: true),
qqnumber = table.Column<string>(type: "text", nullable: true),
point = table.Column<int>(type: "integer", nullable: true),
roleListName = table.Column<string>(type: "text", nullable: true),
roleListCode = table.Column<string>(type: "text", nullable: true),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUsers_F_form_haveformId",
column: x => x.haveformId,
principalTable: "F_form",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "F_Champion",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
formId = table.Column<long>(type: "bigint", nullable: false),
eventsId = table.Column<int>(type: "integer", nullable: false),
msg = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_F_Champion", x => x.Id);
table.ForeignKey(
name: "FK_F_Champion_F_events_eventsId",
column: x => x.eventsId,
principalTable: "F_events",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_F_Champion_F_form_formId",
column: x => x.formId,
principalTable: "F_form",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "F_role",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
formId = table.Column<long>(type: "bigint", nullable: false),
role_id = table.Column<string>(type: "text", nullable: false),
role_name = table.Column<string>(type: "text", nullable: false),
Game_Name = table.Column<string>(type: "text", nullable: true),
role_lin = table.Column<string>(type: "text", nullable: false),
Id_Card = table.Column<string>(type: "text", nullable: true),
Common_Roles = table.Column<string>(type: "text", nullable: true),
Phone_Number = table.Column<string>(type: "text", nullable: true),
Id_Card_Name = table.Column<string>(type: "text", nullable: true),
Historical_Ranks = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_F_role", x => x.Id);
table.ForeignKey(
name: "FK_F_role_F_form_formId",
column: x => x.formId,
principalTable: "F_form",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<long>(type: "bigint", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "text", nullable: false),
ProviderKey = table.Column<string>(type: "text", nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<long>(type: "bigint", nullable: false),
RoleId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<long>(type: "bigint", nullable: false),
LoginProvider = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "IX_AspNetUsers_haveformId",
table: "AspNetUsers",
column: "haveformId");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_F_achlog_teamid",
table: "F_achlog",
column: "teamid");
migrationBuilder.CreateIndex(
name: "IX_F_Champion_eventsId",
table: "F_Champion",
column: "eventsId");
migrationBuilder.CreateIndex(
name: "IX_F_Champion_formId",
table: "F_Champion",
column: "formId");
migrationBuilder.CreateIndex(
name: "IX_F_form_eventsId",
table: "F_form",
column: "eventsId");
migrationBuilder.CreateIndex(
name: "IX_F_role_formId",
table: "F_role",
column: "formId");
migrationBuilder.CreateIndex(
name: "IX_T_Storeinfo_Storeid",
table: "T_Storeinfo",
column: "Storeid");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "F_achlog");
migrationBuilder.DropTable(
name: "F_blog");
migrationBuilder.DropTable(
name: "F_Champion");
migrationBuilder.DropTable(
name: "F_ComForm");
migrationBuilder.DropTable(
name: "F_Friend");
migrationBuilder.DropTable(
name: "F_news");
migrationBuilder.DropTable(
name: "F_qquser");
migrationBuilder.DropTable(
name: "F_role");
migrationBuilder.DropTable(
name: "T_Config");
migrationBuilder.DropTable(
name: "T_Storeinfo");
migrationBuilder.DropTable(
name: "T_Task");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
migrationBuilder.DropTable(
name: "F_game");
migrationBuilder.DropTable(
name: "T_Store");
migrationBuilder.DropTable(
name: "F_form");
migrationBuilder.DropTable(
name: "F_events");
}
}
}