using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace asg_form.Migrations { /// public partial class guid : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), msg = table.Column(type: "text", nullable: true), Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), ConcurrencyStamp = table.Column(type: "text", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetRoles", x => x.Id); }); migrationBuilder.CreateTable( name: "F_blog", columns: table => new { ID = table.Column(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), title = table.Column(type: "text", nullable: false), msg = table.Column(type: "text", nullable: false), formuser = table.Column(type: "text", nullable: false), pushtime = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), UserId = table.Column(type: "integer", nullable: false), comSex = table.Column(type: "text", nullable: false), Com_Cocial_media = table.Column(type: "text", nullable: false), idv_id = table.Column(type: "text", nullable: false), introduction = table.Column(type: "text", nullable: false), Com_qq = table.Column(type: "text", nullable: false), Status = table.Column(type: "text", nullable: false), createTime = table.Column(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(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), name = table.Column(type: "text", nullable: true), is_over = table.Column(type: "boolean", nullable: true), opentime = table.Column(type: "timestamp with time zone", nullable: true), events_rule_uri = table.Column(type: "text", nullable: true), promChart = table.Column(type: "text", nullable: true), status = table.Column(type: "text", nullable: false), config = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), headName = table.Column(type: "text", nullable: false), comMsg = table.Column(type: "text", nullable: false), headTel = table.Column(type: "text", nullable: false), account = table.Column(type: "text", nullable: false), comTime = table.Column(type: "timestamp with time zone", nullable: false), comType = table.Column(type: "text", nullable: false), orgName = table.Column(type: "text", nullable: false), degree = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), team1_name = table.Column(type: "text", nullable: false), team1_piaoshu = table.Column(type: "integer", nullable: false), team2_name = table.Column(type: "text", nullable: false), team2_piaoshu = table.Column(type: "integer", nullable: false), opentime = table.Column(type: "text", nullable: false), commentary = table.Column(type: "text", nullable: false), referee = table.Column(type: "text", nullable: true), referee_Id = table.Column(type: "integer", nullable: true), bilibiliuri = table.Column(type: "text", nullable: true), winteam = table.Column(type: "text", nullable: true), tag = table.Column(type: "text", nullable: true), belong = table.Column(type: "text", nullable: true), judge = table.Column(type: "text", nullable: true), judge_Id = table.Column(type: "integer", nullable: true), com_limit = table.Column(type: "integer", nullable: false), person_type = table.Column(type: "text", nullable: true), final_score = table.Column(type: "text", nullable: true), Remarks = table.Column(type: "text", nullable: true), isAllowChoose = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Title = table.Column(type: "text", nullable: false), FormName = table.Column(type: "text", nullable: false), time = table.Column(type: "text", nullable: false), msg = table.Column(type: "text", nullable: false), Type = table.Column(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(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), qqid = table.Column(type: "text", nullable: false), money = table.Column(type: "integer", nullable: false), time = table.Column(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(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), Title = table.Column(type: "text", nullable: false), Substance = table.Column(type: "text", nullable: false), msg = table.Column(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(type: "uuid", nullable: false), Name = table.Column(type: "text", nullable: false), Price = table.Column(type: "bigint", nullable: false), description = table.Column(type: "text", nullable: false), information = table.Column(type: "text", nullable: false), Type = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), chinaname = table.Column(type: "text", nullable: false), createPerson = table.Column(type: "text", nullable: false), createUserId = table.Column(type: "bigint", nullable: true), userId = table.Column(type: "bigint", nullable: false), taskName = table.Column(type: "text", nullable: false), taskDescription = table.Column(type: "text", nullable: false), status = table.Column(type: "text", nullable: false), money = table.Column(type: "bigint", nullable: false), createTime = table.Column(type: "text", nullable: false), lastOperateTime = table.Column(type: "text", nullable: false), approvalPerson = table.Column(type: "text", nullable: false), priority = table.Column(type: "text", nullable: false) }, constraints: table => { table.PrimaryKey("PK_T_Task", x => x.id); }); migrationBuilder.CreateTable( name: "AspNetRoleClaims", columns: table => new { Id = table.Column(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), RoleId = table.Column(type: "bigint", nullable: false), ClaimType = table.Column(type: "text", nullable: true), ClaimValue = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), piaoshu = table.Column(type: "integer", nullable: false), time = table.Column(type: "timestamp with time zone", nullable: false), team_name = table.Column(type: "text", nullable: false), team_password = table.Column(type: "text", nullable: false), team_tel = table.Column(type: "text", nullable: false), logo_uri = table.Column(type: "text", nullable: false), eventsId = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), userid = table.Column(type: "text", nullable: false), teamid = table.Column(type: "bigint", nullable: false), chickteam = table.Column(type: "text", nullable: false), win = table.Column(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(type: "uuid", nullable: false), buyerid = table.Column(type: "bigint", nullable: false), Storeid = table.Column(type: "uuid", nullable: false), isVerification = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), UserBase64 = table.Column(type: "text", nullable: true), Integral = table.Column(type: "bigint", nullable: true), haveformId = table.Column(type: "bigint", nullable: true), isbooking = table.Column(type: "boolean", nullable: true), chinaname = table.Column(type: "text", nullable: true), officium = table.Column(type: "text", nullable: true), qqnumber = table.Column(type: "text", nullable: true), point = table.Column(type: "integer", nullable: true), roleListName = table.Column(type: "text", nullable: true), roleListCode = table.Column(type: "text", nullable: true), UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), EmailConfirmed = table.Column(type: "boolean", nullable: false), PasswordHash = table.Column(type: "text", nullable: true), SecurityStamp = table.Column(type: "text", nullable: true), ConcurrencyStamp = table.Column(type: "text", nullable: true), PhoneNumber = table.Column(type: "text", nullable: true), PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), TwoFactorEnabled = table.Column(type: "boolean", nullable: false), LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), LockoutEnabled = table.Column(type: "boolean", nullable: false), AccessFailedCount = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), formId = table.Column(type: "bigint", nullable: false), eventsId = table.Column(type: "integer", nullable: false), msg = table.Column(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(type: "bigint", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), formId = table.Column(type: "bigint", nullable: false), role_id = table.Column(type: "text", nullable: false), role_name = table.Column(type: "text", nullable: false), Game_Name = table.Column(type: "text", nullable: true), role_lin = table.Column(type: "text", nullable: false), Id_Card = table.Column(type: "text", nullable: true), Common_Roles = table.Column(type: "text", nullable: true), Phone_Number = table.Column(type: "text", nullable: true), Id_Card_Name = table.Column(type: "text", nullable: true), Historical_Ranks = table.Column(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(type: "integer", nullable: false) .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), UserId = table.Column(type: "bigint", nullable: false), ClaimType = table.Column(type: "text", nullable: true), ClaimValue = table.Column(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(type: "text", nullable: false), ProviderKey = table.Column(type: "text", nullable: false), ProviderDisplayName = table.Column(type: "text", nullable: true), UserId = table.Column(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(type: "bigint", nullable: false), RoleId = table.Column(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(type: "bigint", nullable: false), LoginProvider = table.Column(type: "text", nullable: false), Name = table.Column(type: "text", nullable: false), Value = table.Column(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"); } /// 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"); } } }