2018-09-23 20:45:54 -04:00
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
2018-04-08 17:50:58 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2020-11-27 22:52:52 -05:00
|
|
|
|
namespace SharedLibraryCore.Migrations.Postgresql
|
2018-04-08 17:50:58 -04:00
|
|
|
|
{
|
|
|
|
|
public partial class InitialCreate : Migration
|
|
|
|
|
{
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFAliasLinks",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
AliasLinkId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFAliasLinks", x => x.AliasLinkId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFServers",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
2018-09-23 20:45:54 -04:00
|
|
|
|
ServerId = table.Column<int>(nullable: false)
|
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
Port = table.Column<int>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFServers", x => x.ServerId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "Vector3",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Vector3Id = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
X = table.Column<float>(nullable: false),
|
|
|
|
|
Y = table.Column<float>(nullable: false),
|
|
|
|
|
Z = table.Column<float>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_Vector3", x => x.Vector3Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFAlias",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
AliasId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
DateAdded = table.Column<DateTime>(nullable: false),
|
|
|
|
|
IPAddress = table.Column<int>(nullable: false),
|
|
|
|
|
LinkId = table.Column<int>(nullable: false),
|
2018-09-23 20:45:54 -04:00
|
|
|
|
Name = table.Column<string>(maxLength: 128, nullable: false)
|
2018-04-08 17:50:58 -04:00
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFAlias", x => x.AliasId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFAlias_EFAliasLinks_LinkId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.LinkId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFAliasLinks",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "AliasLinkId",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "EFServerStatistics",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
StatisticId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
ServerId = table.Column<int>(nullable: false),
|
|
|
|
|
TotalKills = table.Column<long>(nullable: false),
|
|
|
|
|
TotalPlayTime = table.Column<long>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_EFServerStatistics", x => x.StatisticId);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFServerStatistics_EFServers_ServerId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ServerId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFServers",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ServerId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
ClientId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
AliasLinkId = table.Column<int>(nullable: false),
|
|
|
|
|
Connections = table.Column<int>(nullable: false),
|
|
|
|
|
CurrentAliasId = table.Column<int>(nullable: false),
|
|
|
|
|
FirstConnection = table.Column<DateTime>(nullable: false),
|
|
|
|
|
LastConnection = table.Column<DateTime>(nullable: false),
|
|
|
|
|
Level = table.Column<int>(nullable: false),
|
|
|
|
|
Masked = table.Column<bool>(nullable: false),
|
|
|
|
|
NetworkId = table.Column<long>(nullable: false),
|
|
|
|
|
Password = table.Column<string>(nullable: true),
|
|
|
|
|
PasswordSalt = table.Column<string>(nullable: true),
|
|
|
|
|
TotalConnectionTime = table.Column<int>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFClients", x => x.ClientId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClients_EFAliasLinks_AliasLinkId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.AliasLinkId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFAliasLinks",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "AliasLinkId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClients_EFAlias_CurrentAliasId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.CurrentAliasId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFAlias",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "AliasId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
KillId = table.Column<long>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true).
|
|
|
|
|
Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
AttackerId = table.Column<int>(nullable: false),
|
|
|
|
|
Damage = table.Column<int>(nullable: false),
|
|
|
|
|
DeathOriginVector3Id = table.Column<int>(nullable: true),
|
|
|
|
|
DeathType = table.Column<int>(nullable: false),
|
|
|
|
|
HitLoc = table.Column<int>(nullable: false),
|
|
|
|
|
KillOriginVector3Id = table.Column<int>(nullable: true),
|
|
|
|
|
Map = table.Column<int>(nullable: false),
|
|
|
|
|
ServerId = table.Column<int>(nullable: false),
|
|
|
|
|
VictimId = table.Column<int>(nullable: false),
|
|
|
|
|
ViewAnglesVector3Id = table.Column<int>(nullable: true),
|
|
|
|
|
Weapon = table.Column<int>(nullable: false),
|
|
|
|
|
When = table.Column<DateTime>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFClientKills", x => x.KillId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_EFClients_AttackerId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.AttackerId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_Vector3_DeathOriginVector3Id",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.DeathOriginVector3Id,
|
|
|
|
|
principalTable: "Vector3",
|
|
|
|
|
principalColumn: "Vector3Id",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_Vector3_KillOriginVector3Id",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.KillOriginVector3Id,
|
|
|
|
|
principalTable: "Vector3",
|
|
|
|
|
principalColumn: "Vector3Id",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_EFServers_ServerId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ServerId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFServers",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ServerId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_EFClients_VictimId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.VictimId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientKills_Vector3_ViewAnglesVector3Id",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ViewAnglesVector3Id,
|
|
|
|
|
principalTable: "Vector3",
|
|
|
|
|
principalColumn: "Vector3Id",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClientMessages",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
MessageId = table.Column<long>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
ClientId = table.Column<int>(nullable: false),
|
|
|
|
|
Message = table.Column<string>(nullable: true),
|
|
|
|
|
ServerId = table.Column<int>(nullable: false),
|
|
|
|
|
TimeSent = table.Column<DateTime>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFClientMessages", x => x.MessageId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientMessages_EFClients_ClientId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ClientId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientMessages_EFServers_ServerId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ServerId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFServers",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ServerId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "EFClientStatistics",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
ClientId = table.Column<int>(nullable: false),
|
|
|
|
|
ServerId = table.Column<int>(nullable: false),
|
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
Deaths = table.Column<int>(nullable: false),
|
|
|
|
|
Kills = table.Column<int>(nullable: false),
|
|
|
|
|
SPM = table.Column<double>(nullable: false),
|
|
|
|
|
Skill = table.Column<double>(nullable: false),
|
|
|
|
|
TimePlayed = table.Column<int>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_EFClientStatistics", x => new { x.ClientId, x.ServerId });
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientStatistics_EFClients_ClientId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ClientId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFClientStatistics_EFServers_ServerId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.ServerId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFServers",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ServerId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFPenalties",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
PenaltyId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true)
|
|
|
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
|
|
|
|
|
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
|
|
|
|
Expires = table.Column<DateTime>(nullable: false),
|
|
|
|
|
LinkId = table.Column<int>(nullable: false),
|
|
|
|
|
OffenderId = table.Column<int>(nullable: false),
|
|
|
|
|
Offense = table.Column<string>(nullable: false),
|
|
|
|
|
PunisherId = table.Column<int>(nullable: false),
|
|
|
|
|
Type = table.Column<int>(nullable: false),
|
|
|
|
|
When = table.Column<DateTime>(nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFPenalties", x => x.PenaltyId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFPenalties_EFAliasLinks_LinkId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.LinkId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFAliasLinks",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "AliasLinkId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFPenalties_EFClients_OffenderId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.OffenderId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFPenalties_EFClients_PunisherId",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: x => x.PunisherId,
|
2018-04-09 15:17:10 -04:00
|
|
|
|
principalTable: "EFClients",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Restrict);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFHitLocationCounts",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
HitLocationCountId = table.Column<int>(nullable: false)
|
2018-09-23 20:45:54 -04:00
|
|
|
|
.Annotation("Sqlite:Autoincrement", true).
|
|
|
|
|
Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn).
|
|
|
|
|
Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
Active = table.Column<bool>(nullable: false),
|
2018-04-09 15:17:10 -04:00
|
|
|
|
EFClientStatistics_ClientId = table.Column<int>(nullable: false),
|
2018-04-08 17:50:58 -04:00
|
|
|
|
HitCount = table.Column<int>(nullable: false),
|
|
|
|
|
HitOffsetAverage = table.Column<float>(nullable: false),
|
2018-04-09 15:17:10 -04:00
|
|
|
|
Location = table.Column<int>(nullable: false),
|
|
|
|
|
EFClientStatistics_ServerId = table.Column<int>(nullable: false)
|
2018-04-08 17:50:58 -04:00
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
2018-04-09 15:17:10 -04:00
|
|
|
|
table.PrimaryKey("PK_EFHitLocationCounts", x => x.HitLocationCountId);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
table.ForeignKey(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "FK_EFHitLocationCounts_EFClients_EFClientStatistics_ClientId",
|
|
|
|
|
column: x => x.EFClientStatistics_ClientId,
|
|
|
|
|
principalTable: "EFClients",
|
|
|
|
|
principalColumn: "ClientId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_EFHitLocationCounts_EFServers_EFClientStatistics_ServerId",
|
|
|
|
|
column: x => x.EFClientStatistics_ServerId,
|
|
|
|
|
principalTable: "EFServers",
|
|
|
|
|
principalColumn: "ServerId",
|
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
|
table.ForeignKey(
|
|
|
|
|
name: "FK_EFHitLocationCounts_EFClientStatistics_EFClientStatistics_ClientId_EFClientStatistics_ServerId",
|
|
|
|
|
columns: x => new { x.EFClientStatistics_ClientId, x.EFClientStatistics_ServerId },
|
2018-04-08 17:50:58 -04:00
|
|
|
|
principalTable: "EFClientStatistics",
|
|
|
|
|
principalColumns: new[] { "ClientId", "ServerId" },
|
2018-04-09 15:17:10 -04:00
|
|
|
|
onDelete: ReferentialAction.Cascade);
|
2018-04-08 17:50:58 -04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFAlias_LinkId",
|
|
|
|
|
table: "EFAlias",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "LinkId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_AttackerId",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "AttackerId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_DeathOriginVector3Id",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "DeathOriginVector3Id");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_KillOriginVector3Id",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "KillOriginVector3Id");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_ServerId",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "ServerId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_VictimId",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "VictimId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientKills_ViewAnglesVector3Id",
|
|
|
|
|
table: "EFClientKills",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "ViewAnglesVector3Id");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientMessages_ClientId",
|
|
|
|
|
table: "EFClientMessages",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "ClientId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFClientMessages_ServerId",
|
|
|
|
|
table: "EFClientMessages",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "ServerId");
|
|
|
|
|
|
2018-04-09 15:17:10 -04:00
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_EFClients_AliasLinkId",
|
|
|
|
|
table: "EFClients",
|
|
|
|
|
column: "AliasLinkId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_EFClients_CurrentAliasId",
|
|
|
|
|
table: "EFClients",
|
|
|
|
|
column: "CurrentAliasId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_EFClients_NetworkId",
|
|
|
|
|
table: "EFClients",
|
|
|
|
|
column: "NetworkId",
|
|
|
|
|
unique: true);
|
|
|
|
|
|
2018-04-08 17:50:58 -04:00
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_EFClientStatistics_ServerId",
|
|
|
|
|
table: "EFClientStatistics",
|
|
|
|
|
column: "ServerId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFHitLocationCounts_EFClientStatistics_ServerId",
|
|
|
|
|
table: "EFHitLocationCounts",
|
|
|
|
|
column: "EFClientStatistics_ServerId");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFHitLocationCounts_EFClientStatistics_ClientId_EFClientStatistics_ServerId",
|
|
|
|
|
table: "EFHitLocationCounts",
|
|
|
|
|
columns: new[] { "EFClientStatistics_ClientId", "EFClientStatistics_ServerId" });
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFPenalties_LinkId",
|
|
|
|
|
table: "EFPenalties",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "LinkId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFPenalties_OffenderId",
|
|
|
|
|
table: "EFPenalties",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "OffenderId");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "IX_EFPenalties_PunisherId",
|
|
|
|
|
table: "EFPenalties",
|
2018-04-08 17:50:58 -04:00
|
|
|
|
column: "PunisherId");
|
2018-04-09 15:17:10 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateIndex(
|
|
|
|
|
name: "IX_EFServerStatistics_ServerId",
|
|
|
|
|
table: "EFServerStatistics",
|
|
|
|
|
column: "ServerId");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClientKills");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClientMessages");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFHitLocationCounts");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFPenalties");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFServerStatistics");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "Vector3");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "EFClientStatistics");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFClients");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFServers");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFAlias");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
2018-04-09 15:17:10 -04:00
|
|
|
|
name: "EFAliasLinks");
|
2018-04-08 17:50:58 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|