using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Socialize.Api.Migrations { /// public partial class AddFeedbackCommentsActivity : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "FeedbackActivityEntries", columns: table => new { Id = table.Column(type: "uuid", nullable: false), FeedbackReportId = table.Column(type: "uuid", nullable: false), ActorUserId = table.Column(type: "uuid", nullable: false), ActorDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), ActorEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), ActivityType = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), FromValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), ToValue = table.Column(type: "character varying(512)", maxLength: 512, nullable: true), Note = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP") }, constraints: table => { table.PrimaryKey("PK_FeedbackActivityEntries", x => x.Id); table.ForeignKey( name: "FK_FeedbackActivityEntries_FeedbackReports_FeedbackReportId", column: x => x.FeedbackReportId, principalTable: "FeedbackReports", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "FeedbackComments", columns: table => new { Id = table.Column(type: "uuid", nullable: false), FeedbackReportId = table.Column(type: "uuid", nullable: false), AuthorUserId = table.Column(type: "uuid", nullable: false), AuthorDisplayName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), AuthorEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), AuthorRole = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), Body = table.Column(type: "character varying(8000)", maxLength: 8000, nullable: false), CreatedAt = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP") }, constraints: table => { table.PrimaryKey("PK_FeedbackComments", x => x.Id); table.ForeignKey( name: "FK_FeedbackComments_FeedbackReports_FeedbackReportId", column: x => x.FeedbackReportId, principalTable: "FeedbackReports", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_FeedbackActivityEntries_ActorUserId", table: "FeedbackActivityEntries", column: "ActorUserId"); migrationBuilder.CreateIndex( name: "IX_FeedbackActivityEntries_CreatedAt", table: "FeedbackActivityEntries", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_FeedbackActivityEntries_FeedbackReportId", table: "FeedbackActivityEntries", column: "FeedbackReportId"); migrationBuilder.CreateIndex( name: "IX_FeedbackComments_AuthorUserId", table: "FeedbackComments", column: "AuthorUserId"); migrationBuilder.CreateIndex( name: "IX_FeedbackComments_CreatedAt", table: "FeedbackComments", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_FeedbackComments_FeedbackReportId", table: "FeedbackComments", column: "FeedbackReportId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "FeedbackActivityEntries"); migrationBuilder.DropTable( name: "FeedbackComments"); } } }