Skip to content

Commit

Permalink
Add indexes (#7)
Browse files Browse the repository at this point in the history
* [add-indexes]: added 20231122_06_extra_indexes.yml - indexes for foreign keys

* [add-indexes]: formatted ci
  • Loading branch information
vlaship authored Jan 21, 2024
1 parent 63b0a5c commit 9a78120
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 30 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
Expand All @@ -19,26 +12,26 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew clean build -x test
- uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'

- name: Cache Gradle dependencies
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Build with Gradle
run: ./gradlew clean build -x test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
databaseChangeLog:
- changeSet:
id: 20231122_06_01
author: vlaship
changes:
- createIndex:
tableName: categories
indexName: categories_parent_id_idx
columns:
- column:
name: parent_id

- changeSet:
id: 20231122_06_02
author: vlaship
changes:
- createIndex:
tableName: category_product
indexName: category_product_category_id_idx
columns:
- column:
name: category_id

- changeSet:
id: 20231122_06_03
author: vlaship
changes:
- createIndex:
tableName: category_product
indexName: category_product_product_id_idx
columns:
- column:
name: product_id

- changeSet:
id: 20231122_06_04
author: vlaship
changes:
- createIndex:
tableName: prices
indexName: prices_product_id_idx
columns:
- column:
name: product_id
2 changes: 2 additions & 0 deletions src/main/resources/db/changelog/db.changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ databaseChangeLog:
file: db/changelog/2023/11/20231122_04_create_category_product.yml
- include:
file: db/changelog/2023/11/20231122_05_create_prices.yml
- include:
file: db/changelog/2023/11/20231122_06_extra_indexes.yml

0 comments on commit 9a78120

Please sign in to comment.