using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Bit.MySqlMigrations.Migrations { /// public partial class CreateOpaqueKeyExchangeCredential : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "OpaqueKeyExchangeCredential", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CipherConfiguration = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CredentialBlob = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), EncryptedPublicKey = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), EncryptedPrivateKey = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), EncryptedUserKey = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreationDate = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_OpaqueKeyExchangeCredential", x => x.Id); table.ForeignKey( name: "FK_OpaqueKeyExchangeCredential_User_UserId", column: x => x.UserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_OpaqueKeyExchangeCredential_UserId", table: "OpaqueKeyExchangeCredential", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "OpaqueKeyExchangeCredential"); } } }