using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GeoRitmMover.Mover.Data.Migrations;

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

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

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