using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Govor.Domain.Migrations { /// public partial class MessagingAndUserBenefits : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "ForwardedFromMessageId", table: "Messages", type: "uuid", nullable: true); migrationBuilder.AddColumn( name: "ForwardedFromSentAt", table: "Messages", type: "timestamp with time zone", nullable: true); migrationBuilder.AddColumn( name: "ForwardedFromUserId", table: "Messages", type: "uuid", nullable: true); migrationBuilder.CreateTable( name: "UserBenefits", columns: table => new { UserId = table.Column(type: "uuid", nullable: false), Privileges = table.Column(type: "bigint", nullable: false), TagJson = table.Column(type: "character varying(4000)", maxLength: 4000, nullable: true) }, constraints: table => { table.PrimaryKey("PK_UserBenefits", x => x.UserId); table.ForeignKey( name: "FK_UserBenefits_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserBenefits"); migrationBuilder.DropColumn( name: "ForwardedFromMessageId", table: "Messages"); migrationBuilder.DropColumn( name: "ForwardedFromSentAt", table: "Messages"); migrationBuilder.DropColumn( name: "ForwardedFromUserId", table: "Messages"); } } }