mirror of
https://github.com/bitwarden/server.git
synced 2025-06-24 20:58:49 -05:00
PM-20574 adding index in scripts and missing table
This commit is contained in:
parent
ceebfd7f57
commit
7151ae40bd
@ -14,6 +14,10 @@ BEGIN
|
|||||||
|
|
||||||
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId]
|
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId]
|
||||||
ON [dbo].[OrganizationReport]([OrganizationId] ASC);
|
ON [dbo].[OrganizationReport]([OrganizationId] ASC);
|
||||||
|
|
||||||
|
CREATE NONCLUSTERED INDEX [IX_OrganizationReport_OrganizationId_Date]
|
||||||
|
ON [dbo].[OrganizationReport]([OrganizationId] ASC, [Date] DESC);
|
||||||
|
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
@ -76,6 +76,12 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
|||||||
name: "IX_OrganizationReport_OrganizationId",
|
name: "IX_OrganizationReport_OrganizationId",
|
||||||
table: "OrganizationReport",
|
table: "OrganizationReport",
|
||||||
column: "OrganizationId");
|
column: "OrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationReport_OrganizationId_Date",
|
||||||
|
table: "OrganizationReport",
|
||||||
|
columns: ["OrganizationId", "Date"],
|
||||||
|
descending: [false, true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -72,6 +72,12 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
|||||||
name: "IX_OrganizationReport_OrganizationId",
|
name: "IX_OrganizationReport_OrganizationId",
|
||||||
table: "OrganizationReport",
|
table: "OrganizationReport",
|
||||||
column: "OrganizationId");
|
column: "OrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationReport_OrganizationId_Date",
|
||||||
|
table: "OrganizationReport",
|
||||||
|
columns: ["OrganizationId", "Date"],
|
||||||
|
descending: [false, true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -31,6 +31,29 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "OrganizationReport",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
OrganizationId = table.Column<Guid>(type: "TEXT", nullable: false),
|
||||||
|
Date = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||||
|
ReportData = table.Column<string>(type: "TEXT", nullable: false),
|
||||||
|
CreationDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||||
|
RevisionDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_OrganizationReport", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_OrganizationReport_Organization_OrganizationId",
|
||||||
|
column: x => x.OrganizationId,
|
||||||
|
principalTable: "Organization",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
})
|
||||||
|
.Annotation("MySql:CharSet", "utf8mb4");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_OrganizationApplication_Id",
|
name: "IX_OrganizationApplication_Id",
|
||||||
table: "OrganizationApplication",
|
table: "OrganizationApplication",
|
||||||
@ -40,6 +63,23 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
|||||||
name: "IX_OrganizationApplication_OrganizationId",
|
name: "IX_OrganizationApplication_OrganizationId",
|
||||||
table: "OrganizationApplication",
|
table: "OrganizationApplication",
|
||||||
column: "OrganizationId");
|
column: "OrganizationId");
|
||||||
|
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationReport_Id",
|
||||||
|
table: "OrganizationReport",
|
||||||
|
column: "Id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationReport_OrganizationId",
|
||||||
|
table: "OrganizationReport",
|
||||||
|
column: "OrganizationId");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_OrganizationReport_OrganizationId_Date",
|
||||||
|
table: "OrganizationReport",
|
||||||
|
columns: ["OrganizationId", "Date"],
|
||||||
|
descending: [false, true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -47,5 +87,8 @@ public partial class _2025061300_OrganizationReportsql : Migration
|
|||||||
{
|
{
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "OrganizationApplication");
|
name: "OrganizationApplication");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "OrganizationReport");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user