117 lines
5.9 KiB
C#
117 lines
5.9 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Socialize.Api.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddFeedbackFoundation : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "FeedbackReports",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Type = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
|
Status = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false),
|
|
Description = table.Column<string>(type: "character varying(8000)", maxLength: 8000, nullable: false),
|
|
ReporterUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
ReporterDisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
ReporterEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
|
|
SubmittedPath = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
|
|
BrowserUserAgent = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: true),
|
|
ViewportWidth = table.Column<int>(type: "integer", nullable: true),
|
|
ViewportHeight = table.Column<int>(type: "integer", nullable: true),
|
|
AppVersion = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
|
|
WorkspaceId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
WorkspaceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ClientId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ClientName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ProjectId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ProjectName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
ContentItemId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
ContentItemTitle = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
|
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
|
|
LastActivityAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
|
CancelledAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
|
CancelledByUserId = table.Column<Guid>(type: "uuid", nullable: true),
|
|
CancellationReason = table.Column<string>(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<Guid>(type: "uuid", nullable: false),
|
|
FeedbackReportId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
|
|
NormalizedName = table.Column<string>(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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "FeedbackTags");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "FeedbackReports");
|
|
}
|
|
}
|
|
}
|