using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Musify.Infrastructure.Persistence.Migrations
{
///
public partial class AddUploadIntentTable : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "UploadIntents",
columns: table => new
{
Id = table.Column(type: "uuid", nullable: false),
UserId = table.Column(type: "uuid", nullable: false),
Bucket = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
Key = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
ObjectName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
ContentType = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
ExpectedSizeBytes = table.Column(type: "bigint", nullable: true),
Purpose = table.Column(type: "integer", nullable: false),
Status = table.Column(type: "integer", nullable: false),
ExpiresAt = table.Column(type: "timestamp with time zone", nullable: false),
CreatedAt = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UploadIntents", x => x.Id);
table.ForeignKey(
name: "FK_UploadIntents_User_UserId",
column: x => x.UserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_UploadIntents_UserId",
table: "UploadIntents",
column: "UserId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UploadIntents");
}
}
}