using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Bit.SqliteMigrations.Migrations; /// public partial class UserSignatureKeyPair : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "SignedPublicKey", table: "User", type: "TEXT", nullable: true); migrationBuilder.CreateTable( name: "UserSignatureKeyPair", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), UserId = table.Column(type: "TEXT", nullable: false), SignatureAlgorithm = table.Column(type: "INTEGER", nullable: false), VerifyingKey = table.Column(type: "TEXT", maxLength: 500, nullable: false), SigningKey = table.Column(type: "TEXT", maxLength: 500, nullable: false), CreationDate = table.Column(type: "TEXT", nullable: false), RevisionDate = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_UserSignatureKeyPair", x => x.Id); table.ForeignKey( name: "FK_UserSignatureKeyPair_User_UserId", column: x => x.UserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_UserSignatureKeyPair_UserId", table: "UserSignatureKeyPair", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "UserSignatureKeyPair"); migrationBuilder.DropColumn( name: "SignedPublicKey", table: "User"); } }