From efe464d141b78bf526807fe38ffed406ab964d79 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Mon, 10 Jun 2024 13:23:40 +0700 Subject: [PATCH] Add OrgId index to migration This was done by editing the migration by hand, which is only a good idea if it has not yet been applied. But since running `skaffold delete` will delete the DB and let it be re-created, this is not a major problem since this PR is still in progress and has not yet been merged. --- .../20240606084230_AddOrgProjectsTable.Designer.cs | 2 ++ .../LexData/Migrations/20240606084230_AddOrgProjectsTable.cs | 5 +++++ backend/LexData/Migrations/LexBoxDbContextModelSnapshot.cs | 2 ++ 3 files changed, 9 insertions(+) diff --git a/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.Designer.cs b/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.Designer.cs index 762cd37316..42c80a2df1 100644 --- a/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.Designer.cs +++ b/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.Designer.cs @@ -634,6 +634,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("OrgId"); + b.HasIndex("ProjectId"); b.HasIndex("OrgId", "ProjectId") diff --git a/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.cs b/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.cs index 25b5bf622c..41023967b2 100644 --- a/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.cs +++ b/backend/LexData/Migrations/20240606084230_AddOrgProjectsTable.cs @@ -44,6 +44,11 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: new[] { "OrgId", "ProjectId" }, unique: true); + migrationBuilder.CreateIndex( + name: "IX_OrgProjects_OrgId", + table: "OrgProjects", + column: "OrgId"); + migrationBuilder.CreateIndex( name: "IX_OrgProjects_ProjectId", table: "OrgProjects", diff --git a/backend/LexData/Migrations/LexBoxDbContextModelSnapshot.cs b/backend/LexData/Migrations/LexBoxDbContextModelSnapshot.cs index 3fdd7df2a7..5542317887 100644 --- a/backend/LexData/Migrations/LexBoxDbContextModelSnapshot.cs +++ b/backend/LexData/Migrations/LexBoxDbContextModelSnapshot.cs @@ -629,6 +629,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); + b.HasIndex("OrgId"); + b.HasIndex("ProjectId"); b.HasIndex("OrgId", "ProjectId")