Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additional indices for query database
Fixes #179
- Loading branch information
Showing
5 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
case-service/src/main/scala/org/cafienne/service/db/querydb/QueryDB.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
package org.cafienne.service.db.querydb | ||
|
||
import org.cafienne.infrastructure.jdbc.schema.CafienneDatabaseDefinition | ||
import org.cafienne.service.db.querydb.schema.versions.{QueryDB_1_0_0, QueryDB_1_1_10, QueryDB_1_1_5, QueryDB_1_1_6} | ||
import org.cafienne.service.db.querydb.schema.versions.{QueryDB_1_0_0, QueryDB_1_1_10, QueryDB_1_1_11, QueryDB_1_1_5, QueryDB_1_1_6} | ||
|
||
object QueryDB extends CafienneDatabaseDefinition with QueryDBSchema { | ||
def verifyConnectivity() { | ||
useSchema(Seq(QueryDB_1_0_0, QueryDB_1_1_5, QueryDB_1_1_6, QueryDB_1_1_10)) | ||
useSchema(Seq(QueryDB_1_0_0, QueryDB_1_1_5, QueryDB_1_1_6, QueryDB_1_1_10, QueryDB_1_1_11)) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...rvice/src/main/scala/org/cafienne/service/db/querydb/schema/versions/QueryDB_1_1_11.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.cafienne.service.db.querydb.schema.versions | ||
|
||
import org.cafienne.infrastructure.jdbc.schema.DbSchemaVersion | ||
import org.cafienne.service.api.projection.table.{CaseTables, TaskTables, TenantTables} | ||
import org.cafienne.service.db.querydb.QueryDBSchema | ||
import slick.migration.api.TableMigration | ||
|
||
object QueryDB_1_1_11 extends DbSchemaVersion with QueryDBSchema | ||
with CaseTables | ||
with TaskTables | ||
with TenantTables { | ||
|
||
val version = "1.1.11" | ||
val migrations = ( | ||
// These indices are required for faster updating platform user id's | ||
// Probably also some queries on tasks may become faster ... | ||
addPlanItemIndices & addPlanItemHistoryIndex & addCaseIndices & addCaseTeamIndex & addTaskIndices | ||
|
||
// This index is needed to optimize tenant queries | ||
& addUserRoleIndex | ||
) | ||
|
||
import dbConfig.profile.api._ | ||
|
||
def addPlanItemIndices = TableMigration(TableQuery[PlanItemTable])addIndexes(_.indexCreatedBy, _.indexModifiedBy) | ||
def addPlanItemHistoryIndex = TableMigration(TableQuery[PlanItemHistoryTable])addIndexes(_.indexModifiedBy) | ||
def addCaseIndices = TableMigration(TableQuery[CaseInstanceTable])addIndexes(_.indexCreatedBy, _.indexModifiedBy) | ||
def addCaseTeamIndex = TableMigration(TableQuery[CaseInstanceTeamMemberTable])addIndexes(_.indexMemberId) | ||
def addTaskIndices = TableMigration(TableQuery[TaskTable])addIndexes(_.indexOwner, _.indexCreatedBy, _.indexModifiedBy) | ||
def addUserRoleIndex = TableMigration(TableQuery[UserRoleTable])addIndexes(_.indexOwnership) | ||
|
||
} |