Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Added columnsWithJsonTypeCheckOnHost bean #31

Merged
merged 3 commits into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle and analyze
if: matrix.os == 'ubuntu-latest'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonarqube --info
- name: Build with Gradle
if: matrix.os != 'ubuntu-latest'
run: ./gradlew build
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group 'io.github.mfvanek'
version '0.6.1-SNAPSHOT'
version '0.6.1'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -29,7 +29,7 @@ def junitVersion = '5.9.0'
def springVersion = '2.5.14'
dependencies {
implementation "org.springframework.boot:spring-boot-starter:$springVersion"
api 'io.github.mfvanek:pg-index-health:0.6.0'
api 'io.github.mfvanek:pg-index-health:0.6.1'
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor:$springVersion"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springVersion"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package io.github.mfvanek.pg.spring;

import io.github.mfvanek.pg.checks.host.ColumnsWithJsonTypeCheckOnHost;
import io.github.mfvanek.pg.checks.host.ColumnsWithoutDescriptionCheckOnHost;
import io.github.mfvanek.pg.checks.host.DuplicatedIndexesCheckOnHost;
import io.github.mfvanek.pg.checks.host.ForeignKeysNotCoveredWithIndexCheckOnHost;
Expand Down Expand Up @@ -158,6 +159,14 @@ public ColumnsWithoutDescriptionCheckOnHost columnsWithoutDescriptionCheckOnHost
return new ColumnsWithoutDescriptionCheckOnHost(pgConnection);
}

@Bean
@ConditionalOnClass(ColumnsWithJsonTypeCheckOnHost.class)
@ConditionalOnBean(PgConnection.class)
@ConditionalOnMissingBean
public ColumnsWithJsonTypeCheckOnHost columnsWithJsonTypeCheckOnHost(final PgConnection pgConnection) {
return new ColumnsWithJsonTypeCheckOnHost(pgConnection);
}

@Bean
@ConditionalOnClass(StatisticsMaintenanceOnHost.class)
@ConditionalOnBean(PgConnection.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ abstract class AutoConfigurationTestBase {
"unusedIndexesCheckOnHost",
"tablesWithoutDescriptionCheckOnHost",
"columnsWithoutDescriptionCheckOnHost",
"columnsWithJsonTypeCheckOnHost",
"statisticsMaintenanceOnHost",
"configurationMaintenanceOnHost"
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package io.github.mfvanek.pg.spring;

import io.github.mfvanek.pg.checks.host.ColumnsWithJsonTypeCheckOnHost;
import io.github.mfvanek.pg.checks.host.ColumnsWithoutDescriptionCheckOnHost;
import io.github.mfvanek.pg.checks.host.DuplicatedIndexesCheckOnHost;
import io.github.mfvanek.pg.checks.host.ForeignKeysNotCoveredWithIndexCheckOnHost;
Expand Down Expand Up @@ -65,6 +66,7 @@ void withoutPgConnectionClass() {
UnusedIndexesCheckOnHost.class,
TablesWithoutDescriptionCheckOnHost.class,
ColumnsWithoutDescriptionCheckOnHost.class,
ColumnsWithJsonTypeCheckOnHost.class,
StatisticsMaintenanceOnHost.class,
ConfigurationMaintenanceOnHost.class})
void withoutClass(final Class<?> type) {
Expand Down