using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace FileService.Infrastructure.Migrations { /// public partial class InitFileDb : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "upload_files", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), OwnerId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FileName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FileSize = table.Column(type: "bigint", nullable: false), ContentType = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), State = table.Column(type: "int", nullable: false), checksum_algorithm = table.Column(type: "longtext", nullable: false), checksum_value = table.Column(type: "longtext", nullable: false), storage_bucket = table.Column(type: "longtext", nullable: false), storage_key = table.Column(type: "longtext", nullable: false), storage_region = table.Column(type: "longtext", nullable: true), storage_provider = table.Column(type: "longtext", nullable: false), IsDeleted = table.Column(type: "tinyint(1)", nullable: false), CreationTime = table.Column(type: "datetime(6)", nullable: false), Deletion = table.Column(type: "datetime(6)", nullable: true), ModificationTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_upload_files", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "upload_tasks", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UploaderId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ConversationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FileName = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), FileSize = table.Column(type: "bigint", nullable: false), ContentType = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), State = table.Column(type: "int", nullable: false), checksum_algorithm = table.Column(type: "longtext", nullable: false), checksum_value = table.Column(type: "longtext", nullable: false), storage_bucket = table.Column(type: "longtext", nullable: false), storage_key = table.Column(type: "longtext", nullable: false), storage_region = table.Column(type: "longtext", nullable: true), storage_provider = table.Column(type: "longtext", nullable: false), IsDeleted = table.Column(type: "tinyint(1)", nullable: false), CreationTime = table.Column(type: "datetime(6)", nullable: false), Deletion = table.Column(type: "datetime(6)", nullable: true), ModificationTime = table.Column(type: "datetime(6)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_upload_tasks", x => x.Id); }) .Annotation("MySql:CharSet", "utf8mb4"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "upload_files"); migrationBuilder.DropTable( name: "upload_tasks"); } } }