using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Socialize.Api.Migrations
{
///
public partial class RenameProjectsToCampaigns : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "Projects",
newName: "Campaigns");
migrationBuilder.DropPrimaryKey(
name: "PK_Projects",
table: "Campaigns");
migrationBuilder.AddPrimaryKey(
name: "PK_Campaigns",
table: "Campaigns",
column: "Id");
migrationBuilder.RenameIndex(
name: "IX_Projects_WorkspaceId",
table: "Campaigns",
newName: "IX_Campaigns_WorkspaceId");
migrationBuilder.RenameIndex(
name: "IX_Projects_ClientId_Name",
table: "Campaigns",
newName: "IX_Campaigns_ClientId_Name");
migrationBuilder.RenameIndex(
name: "IX_Projects_ClientId",
table: "Campaigns",
newName: "IX_Campaigns_ClientId");
migrationBuilder.RenameColumn(
name: "ProjectName",
table: "FeedbackReports",
newName: "CampaignName");
migrationBuilder.RenameColumn(
name: "ProjectId",
table: "FeedbackReports",
newName: "CampaignId");
migrationBuilder.RenameColumn(
name: "ProjectId",
table: "ContentItems",
newName: "CampaignId");
migrationBuilder.RenameIndex(
name: "IX_ContentItems_ProjectId",
table: "ContentItems",
newName: "IX_ContentItems_CampaignId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Campaigns",
table: "Campaigns");
migrationBuilder.AddPrimaryKey(
name: "PK_Projects",
table: "Campaigns",
column: "Id");
migrationBuilder.RenameIndex(
name: "IX_Campaigns_WorkspaceId",
table: "Campaigns",
newName: "IX_Projects_WorkspaceId");
migrationBuilder.RenameIndex(
name: "IX_Campaigns_ClientId_Name",
table: "Campaigns",
newName: "IX_Projects_ClientId_Name");
migrationBuilder.RenameIndex(
name: "IX_Campaigns_ClientId",
table: "Campaigns",
newName: "IX_Projects_ClientId");
migrationBuilder.RenameTable(
name: "Campaigns",
newName: "Projects");
migrationBuilder.RenameColumn(
name: "CampaignName",
table: "FeedbackReports",
newName: "ProjectName");
migrationBuilder.RenameColumn(
name: "CampaignId",
table: "FeedbackReports",
newName: "ProjectId");
migrationBuilder.RenameColumn(
name: "CampaignId",
table: "ContentItems",
newName: "ProjectId");
migrationBuilder.RenameIndex(
name: "IX_ContentItems_CampaignId",
table: "ContentItems",
newName: "IX_ContentItems_ProjectId");
}
}
}