fengling-gateway/src/Migrations/20260201133826_AddIsGlobalToTenantRoute.cs
movingsam 564d664426
Some checks failed
Build and Deploy / build (push) Successful in 22s
Build and Deploy / docker (push) Successful in 26m23s
Build and Deploy / deploy (push) Failing after 3s
refactor: move project to src/ and add slnx
- Add YarpGateway.slnx solution file
- Move all project files to src/ directory
- Update Dockerfile for new src/ path structure
- Update CI/CD workflow with src/ project path
- Fix NuGet package references (use Gitea NuGet packages)
- Add CPM (Central Package Management) with Directory.Packages.props
2026-02-28 13:10:41 +08:00

88 lines
2.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace YarpGateway.Migrations
{
/// <inheritdoc />
public partial class AddIsGlobalToTenantRoute : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_TenantRoutes_Tenants_TenantCode",
table: "TenantRoutes");
migrationBuilder.DropUniqueConstraint(
name: "AK_Tenants_TenantCode",
table: "Tenants");
migrationBuilder.DropIndex(
name: "IX_TenantRoutes_TenantCode_ServiceName",
table: "TenantRoutes");
migrationBuilder.AddColumn<bool>(
name: "IsGlobal",
table: "TenantRoutes",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.CreateIndex(
name: "IX_TenantRoutes_ServiceName",
table: "TenantRoutes",
column: "ServiceName");
migrationBuilder.CreateIndex(
name: "IX_TenantRoutes_ServiceName_IsGlobal_Status",
table: "TenantRoutes",
columns: new[] { "ServiceName", "IsGlobal", "Status" });
migrationBuilder.CreateIndex(
name: "IX_TenantRoutes_TenantCode",
table: "TenantRoutes",
column: "TenantCode");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_TenantRoutes_ServiceName",
table: "TenantRoutes");
migrationBuilder.DropIndex(
name: "IX_TenantRoutes_ServiceName_IsGlobal_Status",
table: "TenantRoutes");
migrationBuilder.DropIndex(
name: "IX_TenantRoutes_TenantCode",
table: "TenantRoutes");
migrationBuilder.DropColumn(
name: "IsGlobal",
table: "TenantRoutes");
migrationBuilder.AddUniqueConstraint(
name: "AK_Tenants_TenantCode",
table: "Tenants",
column: "TenantCode");
migrationBuilder.CreateIndex(
name: "IX_TenantRoutes_TenantCode_ServiceName",
table: "TenantRoutes",
columns: new[] { "TenantCode", "ServiceName" },
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_TenantRoutes_Tenants_TenantCode",
table: "TenantRoutes",
column: "TenantCode",
principalTable: "Tenants",
principalColumn: "TenantCode",
onDelete: ReferentialAction.Restrict);
}
}
}