using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql { /// public partial class AppUpdateReleases : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AppUpdateReleases", columns: table => new { Id = table.Column(type: "char(36)", nullable: false), Platform = table.Column(type: "varchar(20)", maxLength: 20, nullable: false), Channel = table.Column(type: "varchar(20)", maxLength: 20, nullable: false), Version = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), NativeVersion = table.Column(type: "varchar(40)", maxLength: 40, nullable: false), Status = table.Column(type: "varchar(20)", maxLength: 20, nullable: false), ReleaseNotes = table.Column(type: "varchar(1000)", maxLength: 1000, nullable: true), FileName = table.Column(type: "varchar(180)", maxLength: 180, nullable: false), FileSize = table.Column(type: "bigint", nullable: false), Sha256 = table.Column(type: "varchar(64)", maxLength: 64, nullable: false), BundleContent = table.Column(type: "longblob", nullable: false), CreatedByUserName = table.Column(type: "varchar(100)", maxLength: 100, nullable: false), PublishedByUserName = table.Column(type: "varchar(100)", maxLength: 100, nullable: true), PublishedAt = table.Column(type: "datetime(6)", nullable: true), CreatedAt = table.Column(type: "datetime(6)", nullable: false), UpdatedAt = table.Column(type: "datetime(6)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AppUpdateReleases", x => x.Id); }) .Annotation("MySQL:Charset", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_AppUpdateReleases_CreatedAt", table: "AppUpdateReleases", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_AppUpdateReleases_Platform_Channel_NativeVersion_Status", table: "AppUpdateReleases", columns: new[] { "Platform", "Channel", "NativeVersion", "Status" }); migrationBuilder.CreateIndex( name: "IX_AppUpdateReleases_Platform_Channel_NativeVersion_Version", table: "AppUpdateReleases", columns: new[] { "Platform", "Channel", "NativeVersion", "Version" }, unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AppUpdateReleases"); } } }