feat: add UserManagementService feat: add CopmanyDriver relation and DriverManagementService chore: pupulate database seeding class fix: add review filtering by CompanyId
49 lines
1.7 KiB
C#
49 lines
1.7 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Server.Migrations
|
|
{
|
|
public partial class Add_CompanyDriver_relation : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "CompanyDrivers",
|
|
columns: table => new
|
|
{
|
|
DriverId = table.Column<string>(type: "text", nullable: false),
|
|
CompanyId = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CompanyDrivers", x => new { x.CompanyId, x.DriverId });
|
|
table.ForeignKey(
|
|
name: "FK_CompanyDrivers_AspNetUsers_DriverId",
|
|
column: x => x.DriverId,
|
|
principalTable: "AspNetUsers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_CompanyDrivers_Companies_CompanyId",
|
|
column: x => x.CompanyId,
|
|
principalTable: "Companies",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CompanyDrivers_DriverId",
|
|
table: "CompanyDrivers",
|
|
column: "DriverId",
|
|
unique: true);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "CompanyDrivers");
|
|
}
|
|
}
|
|
}
|