using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GeoRitmMover.Mover.Data.Migrations;

/// <inheritdoc />
public partial class AddEventCodes : Migration
{
	/// <inheritdoc />
	protected override void Up(MigrationBuilder migrationBuilder)
	{
		_ = migrationBuilder.CreateTable(
			name: "EventCodes",
			columns: table => new
			{
				Id = table.Column<Guid>(type: "uuid", nullable: false),
				From = table.Column<int>(type: "integer", nullable: false),
				To = table.Column<Guid>(type: "uuid", nullable: false)
			},
			constraints: table =>
			{
				_ = table.PrimaryKey("PK_EventCodes", x => x.Id);
			});

		_ = migrationBuilder.CreateIndex(
			name: "IX_EventCodes_From",
			table: "EventCodes",
			column: "From",
			unique: true);

		_ = migrationBuilder.CreateIndex(
			name: "IX_EventCodes_To",
			table: "EventCodes",
			column: "To",
			unique: true);
	}

	/// <inheritdoc />
	protected override void Down(MigrationBuilder migrationBuilder)
	{
		_ = migrationBuilder.DropTable(
			name: "EventCodes");
	}
}
