mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-27 16:09:07 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace RadicadeServer.Migrations
|
||||
{
|
||||
|
||||
public partial class AddPendingSchemaChanges : Migration
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Reputations', 'ReportCount') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Reputations] ADD [ReportCount] int NOT NULL DEFAULT 0;
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Profiles', 'BioLocked') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Profiles] ADD [BioLocked] bit NOT NULL DEFAULT 0;
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Profiles', 'NameLocked') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Profiles] ADD [NameLocked] bit NOT NULL DEFAULT 0;
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Players', 'PendingEmail') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Players] ADD [PendingEmail] nvarchar(max) NULL;
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Avatars', 'EquipmentSlots') IS NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Avatars] ADD [EquipmentSlots] nvarchar(max) NOT NULL DEFAULT '';
|
||||
END");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"UPDATE Reputations SET ReputationScore = 10 WHERE ReputationScore = 0;");
|
||||
}
|
||||
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Reputations', 'ReportCount') IS NOT NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Reputations] DROP COLUMN [ReportCount];
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Profiles', 'BioLocked') IS NOT NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Profiles] DROP COLUMN [BioLocked];
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Profiles', 'NameLocked') IS NOT NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Profiles] DROP COLUMN [NameLocked];
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Players', 'PendingEmail') IS NOT NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Players] DROP COLUMN [PendingEmail];
|
||||
END");
|
||||
|
||||
migrationBuilder.Sql(@"
|
||||
IF COL_LENGTH('Avatars', 'EquipmentSlots') IS NOT NULL
|
||||
BEGIN
|
||||
ALTER TABLE [Avatars] DROP COLUMN [EquipmentSlots];
|
||||
END");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user