using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Messenger.Api.Data.Migrations
{
///
public partial class AddUploadIntents : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "upload_intents",
columns: table => new
{
id = table.Column(type: "uuid", nullable: false),
object_key = table.Column(type: "text", nullable: false),
created_at = table.Column(type: "timestamp with time zone", nullable: false),
expires_at = table.Column(type: "timestamp with time zone", nullable: false),
next_attempt_at = table.Column(type: "timestamp with time zone", nullable: false),
delete_count = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_upload_intents", x => x.id);
});
migrationBuilder.CreateIndex(
name: "ix_upload_intents_next_attempt_at_expires_at",
table: "upload_intents",
columns: new[] { "next_attempt_at", "expires_at" });
migrationBuilder.CreateIndex(
name: "ix_upload_intents_object_key",
table: "upload_intents",
column: "object_key",
unique: true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "upload_intents");
}
}
}