using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Socialize.Api.Migrations
{
///
public partial class AddFeedbackFoundation : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FeedbackReports",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
Type = table.Column(type: "character varying(32)", maxLength: 32, nullable: false),
Status = table.Column(type: "character varying(32)", maxLength: 32, nullable: false),
Description = table.Column(type: "character varying(8000)", maxLength: 8000, nullable: false),
ReporterUserId = table.Column(type: "uuid", nullable: false),
ReporterDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
ReporterEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
SubmittedPath = table.Column(type: "character varying(2048)", maxLength: 2048, nullable: false),
BrowserUserAgent = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true),
ViewportWidth = table.Column(type: "integer", nullable: true),
ViewportHeight = table.Column(type: "integer", nullable: true),
AppVersion = table.Column(type: "character varying(128)", maxLength: 128, nullable: true),
WorkspaceId = table.Column(type: "uuid", nullable: true),
WorkspaceName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
ClientId = table.Column(type: "uuid", nullable: true),
ClientName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
ProjectId = table.Column(type: "uuid", nullable: true),
ProjectName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
ContentItemId = table.Column(type: "uuid", nullable: true),
ContentItemTitle = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
CreatedAt = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
LastActivityAt = table.Column(type: "timestamp with time zone", nullable: false),
CancelledAt = table.Column(type: "timestamp with time zone", nullable: true),
CancelledByUserId = table.Column(type: "uuid", nullable: true),
CancellationReason = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FeedbackReports", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FeedbackTags",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
FeedbackReportId = table.Column(type: "uuid", nullable: false),
Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: false),
NormalizedName = table.Column(type: "character varying(64)", maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FeedbackTags", x => x.Id);
table.ForeignKey(
name: "FK_FeedbackTags_FeedbackReports_FeedbackReportId",
column: x => x.FeedbackReportId,
principalTable: "FeedbackReports",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_FeedbackReports_LastActivityAt",
table: "FeedbackReports",
column: "LastActivityAt");
migrationBuilder.CreateIndex(
name: "IX_FeedbackReports_ReporterUserId",
table: "FeedbackReports",
column: "ReporterUserId");
migrationBuilder.CreateIndex(
name: "IX_FeedbackReports_Status",
table: "FeedbackReports",
column: "Status");
migrationBuilder.CreateIndex(
name: "IX_FeedbackReports_Type",
table: "FeedbackReports",
column: "Type");
migrationBuilder.CreateIndex(
name: "IX_FeedbackReports_WorkspaceId",
table: "FeedbackReports",
column: "WorkspaceId");
migrationBuilder.CreateIndex(
name: "IX_FeedbackTags_FeedbackReportId_NormalizedName",
table: "FeedbackTags",
columns: new[] { "FeedbackReportId", "NormalizedName" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_FeedbackTags_NormalizedName",
table: "FeedbackTags",
column: "NormalizedName");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FeedbackTags");
migrationBuilder.DropTable(
name: "FeedbackReports");
}
}
}