Skip to content

Commit

Permalink
feat: added db index (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordenReuter authored Sep 27, 2024
1 parent 2325ee2 commit 2e3b543
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
@Getter
@Setter
@Entity
@Table(name = "BOOKMARK")
@Table(name = "BOOKMARK", indexes = {
@Index(name = "IDX_USER_WORKSPACE_PRODUCT_APP", columnList = "USER_ID, WORKSPACE_NAME, PRODUCT_NAME, APP_ID") })
@SuppressWarnings("java:S2160")
public class Bookmark extends TraceableEntity {

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/db/changeLog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

<include relativeToChangelogFile="true" file="v1/2024-08-13-create-tables.xml"/>
<include relativeToChangelogFile="true" file="v1/2024-09-25-position-field.xml"/>
<include relativeToChangelogFile="true" file="v1/2024-09-27-add-index.xml"/>
</databaseChangeLog>
16 changes: 16 additions & 0 deletions src/main/resources/db/v1/2024-09-27-add-index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>

<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd"
objectQuotingStrategy="QUOTE_ONLY_RESERVED_WORDS">
<changeSet author="dev (generated)" id="1727420631769-1">
<createIndex indexName="idx_user_workspace_product_app" tableName="bookmark">
<column name="user_id"/>
<column name="workspace_name"/>
<column name="product_name"/>
<column name="app_id"/>
</createIndex>
</changeSet>
</databaseChangeLog>

0 comments on commit 2e3b543

Please sign in to comment.