Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database changelog history record-keeping (DAT-16178) #5147

Merged
merged 45 commits into from
Mar 19, 2024
Merged

Conversation

StevenMassaro
Copy link
Contributor

@StevenMassaro StevenMassaro commented Nov 1, 2023

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The current DBCL tracks changes currently applied to a db, but when changes are rolledback, these changeset records dissappear. This new PRO table, DATABASECHANGELOGHISTORY, will track all changes made and rolled back and dropped. The overall goal of this table is track the history of database changing liquibase operations, including rollbacks, dropall, repeated updates of the same changeset, etc.

Things to be aware of

Things to worry about

Additional Context

@@ -23,7 +25,7 @@
return results;
}

public int getExitCode() {
public Integer getExitCode() {

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
ExitCodeException.getExitCode
; it is advisable to add an Override annotation.
private static final long serialVersionUID = 1570124571347160550L;
private Integer exitCode = null;

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
ExitCodeException.getExitCode
; it is advisable to add an Override annotation.
return null;
}

public static class LibraryInfo implements Comparable<LibraryInfo> {

Check warning

Code scanning / CodeQL

Inconsistent compareTo Warning

This class declares
compareTo
but inherits equals; the two could be inconsistent.
@@ -7,4 +7,7 @@
public interface ChangeLogSyncListener {
void markedRan(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database);

default void markedRanFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception e) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'changeSet' is never used.
@@ -7,4 +7,7 @@
public interface ChangeLogSyncListener {
void markedRan(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database);

default void markedRanFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception e) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'databaseChangeLog' is never used.
@@ -7,4 +7,7 @@
public interface ChangeLogSyncListener {
void markedRan(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database);

default void markedRanFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception e) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'database' is never used.
@@ -7,4 +7,7 @@
public interface ChangeLogSyncListener {
void markedRan(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database);

default void markedRanFailed(ChangeSet changeSet, DatabaseChangeLog databaseChangeLog, Database database, Exception e) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'e' is never used.
Copy link

sonarcloud bot commented Nov 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

39.5% 39.5% Coverage
1.3% 1.3% Duplication

@@ -83,6 +89,11 @@
resultsBuilder.addResult("statusCode", 0);
}

public SnapshotControl getSnapshotControl(CommandScope commandScope, Database database) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'commandScope' is never used.
@@ -83,6 +89,11 @@
resultsBuilder.addResult("statusCode", 0);
}

public SnapshotControl getSnapshotControl(CommandScope commandScope, Database database) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'database' is never used.
…5375)

add dbcl-history configuration options to maven plugin
# Conflicts:
#	liquibase-standard/src/main/java/liquibase/command/CommandScope.java
#	liquibase-standard/src/main/java/liquibase/database/Database.java
# Conflicts:
#	liquibase-cli/src/main/java/liquibase/integration/commandline/LiquibaseCommandLine.java
* @parameter property="liquibase.verbose"
*/
@PropertyElement
protected Boolean verbose;

Check warning

Code scanning / CodeQL

Field masks field in super class Warning

This field shadows another field called
verbose
in a superclass.
…en (DAT-16881) (#5609)

fix dbclHistoryEnabled property from liquibase.properties file in maven
record executed SQL in ChangelogJdbcMdcListener
default void addCompleteSqlToScope(String completeSql) {
AtomicReference<String> sqlsReference = Scope.getCurrentScope().get(COMPLETE_SQL_SCOPE_KEY, AtomicReference.class);
if (sqlsReference != null) {
sqlsReference.set(completeSql.toString());

Check notice

Code scanning / CodeQL

Useless toString on String Note

Redundant call to 'toString' on a String object.
…0) (#5651)

* add captureExtensions and captureSql params to maven plugin

* update javadoc

* additional javadoc fixes
@StevenMassaro StevenMassaro merged commit 547e54a into master Mar 19, 2024
33 of 35 checks passed
@StevenMassaro StevenMassaro deleted the DAT-16178 branch March 19, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants